private void Add_Click(object sender, System.EventArgs e)
{
DataTable dt = CommonBLL.GetSchema(Utility.Utility.TableName.RepairRecord).Tables[0];
dt.TableName=Utility.Utility.TableName.RepairRecord;
DataRow dr;
dr=dt.NewRow();
dr["RepairBaseId"]=Request["id"].ToString();
dr["Content"]=this.Content.Text;
dr["Repairdate"]=Request.Form["startdate"].ToString();
dr["Repaircost"]=this.repaircost.Text;
dr["UserID"]=Request["userid"].ToString();
dr["Name"]=this.name.Text;
dr["Phone"]=this.phone.Text;
dr["RegTime"]=System.DateTime.Now;
dt.Rows.Add(dr);
CommonBLL.Insert(dt,"ID");
string script="<script language=javascript>alert('增加成功');window.location.href='RepairRecordList.aspx';</script>";
this.Page.RegisterClientScriptBlock("",script);
}
{
DataTable dt = CommonBLL.GetSchema(Utility.Utility.TableName.RepairRecord).Tables[0];
dt.TableName=Utility.Utility.TableName.RepairRecord;
DataRow dr;
dr=dt.NewRow();
dr["RepairBaseId"]=Request["id"].ToString();
dr["Content"]=this.Content.Text;
dr["Repairdate"]=Request.Form["startdate"].ToString();
dr["Repaircost"]=this.repaircost.Text;
dr["UserID"]=Request["userid"].ToString();
dr["Name"]=this.name.Text;
dr["Phone"]=this.phone.Text;
dr["RegTime"]=System.DateTime.Now;
dt.Rows.Add(dr);
CommonBLL.Insert(dt,"ID");
string script="<script language=javascript>alert('增加成功');window.location.href='RepairRecordList.aspx';</script>";
this.Page.RegisterClientScriptBlock("",script);
}
private void Update_Click(object sender, System.EventArgs e)
{
DataTable dt=Repair.RepairModel.GetRepairRecordById(Convert.ToInt32(Request["RepairRecordId"]));
dt.TableName=Utility.Utility.TableName.RepairRecord;
DataRow dr;
dr=dt.Rows[0];
dr["RepairBaseId"]=Request["RepairBaseId"].ToString();
dr["Content"]=this.Content.Text;
dr["Repairdate"]=Request.Form["startdate"].ToString();
dr["Repaircost"]=this.repaircost.Text;
//dr["UserID"]=Request["userid"].ToString();
dr["Name"]=this.name.Text;
dr["Phone"]=this.phone.Text;
// dr["RegTime"]=System.DateTime.Now;
Repair.RepairModel.UpdateRepairBase(dr,dt.TableName,"ID");
string script="<script lanaguage='javascript'>alert('更新成功');window.location.href='RepairRecordDetail.aspx?RepairRecordId="+Convert.ToInt32(Request["RepairRecordId"])+"&userid="+Convert.ToInt32(Request["userid"])+"';</script>";
Page.RegisterStartupScript("",script);
}
{
DataTable dt=Repair.RepairModel.GetRepairRecordById(Convert.ToInt32(Request["RepairRecordId"]));
dt.TableName=Utility.Utility.TableName.RepairRecord;
DataRow dr;
dr=dt.Rows[0];
dr["RepairBaseId"]=Request["RepairBaseId"].ToString();
dr["Content"]=this.Content.Text;
dr["Repairdate"]=Request.Form["startdate"].ToString();
dr["Repaircost"]=this.repaircost.Text;
//dr["UserID"]=Request["userid"].ToString();
dr["Name"]=this.name.Text;
dr["Phone"]=this.phone.Text;
// dr["RegTime"]=System.DateTime.Now;
Repair.RepairModel.UpdateRepairBase(dr,dt.TableName,"ID");
string script="<script lanaguage='javascript'>alert('更新成功');window.location.href='RepairRecordDetail.aspx?RepairRecordId="+Convert.ToInt32(Request["RepairRecordId"])+"&userid="+Convert.ToInt32(Request["userid"])+"';</script>";
Page.RegisterStartupScript("",script);
}