protected void Button2_Click(object sender, EventArgs e) { Maticsoft.BLL.record_FamilyProblem record_FamilyProblem_bll = new Maticsoft.BLL.record_FamilyProblem(); Maticsoft.Model.record_FamilyProblem record_FamilyProblem_model = record_FamilyProblem_bll.GetModel(FamilyID); if (record_FamilyProblem_model == null) { record_FamilyProblem_model = new Maticsoft.Model.record_FamilyProblem(); } record_FamilyProblem_model.F_RecordTime = (DateTime)Common.sink(this.F_RecordTime.UniqueID, MethodType.Post, 255, 0, DataType.Dat); record_FamilyProblem_model.F_StartTime = (DateTime)Common.sink(this.F_StartTime.UniqueID, MethodType.Post, 255, 0, DataType.Dat); record_FamilyProblem_model.F_endTime = (DateTime)Common.sink(this.F_endTime.UniqueID, MethodType.Post, 255, 0, DataType.Dat); record_FamilyProblem_model.F_OverviewProblem = (string)Common.sink(this.F_OverviewProblem.UniqueID, MethodType.Post, 255, 0, DataType.Str); record_FamilyProblem_model.F_DetailProblem = (string)Common.sink(this.F_DetailProblem.UniqueID, MethodType.Post, 255, 0, DataType.Str); record_FamilyProblem_model.F_FillingUserID = Convert.ToInt32(this.F_FillingUserID.Value); if (record_FamilyProblem_model.F_FamilyID == 0) { CMD_Txt = "增加"; record_FamilyProblem_model.F_FamilyID = FamilyID; record_FamilyProblem_bll.Add(record_FamilyProblem_model); } else { CMD_Txt = "修改"; record_FamilyProblem_bll.Update(record_FamilyProblem_model); } All_Title_Txt = CMD_Txt + App_Txt; //以下方法的第4个参数需要更改 EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", record_FamilyProblem_model.F_FamilyID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
/// <summary> /// 在编辑的时候将对应的值绑定到Label上 /// </summary> private void InputData() { Maticsoft.BLL.record_FamilyBaseInfo bll = new Maticsoft.BLL.record_FamilyBaseInfo(); Maticsoft.Model.record_FamilyBaseInfo model = bll.GetModel(FamilyID); F_FamilyTel.Text = model.F_FamilyTel.ToString(); F_HouseType.SelectedValue = model.F_HouseType + ""; F_FamilyAddress.Text = model.F_FamilyAddress; F_FamilyCode.Text = model.F_FamilyCode; F_HouseArea.Text = model.F_HouseArea.ToString(); F_Ventilation.SelectedValue = model.F_Ventilation + ""; F_Humidity.SelectedValue = model.F_Humidity + ""; F_Warm.SelectedValue = model.F_Warm + ""; F_Lighting.SelectedValue = model.F_Lighting + ""; F_Sanitation.SelectedValue = model.F_Sanitation + ""; F_Kitchen.SelectedValue = model.F_Kitchen + ""; F_Fuel.SelectedValue = model.F_Fuel + ""; F_Water.SelectedValue = model.F_Water + ""; F_WasteDisposal.SelectedValue = model.F_WasteDisposal + ""; F_LivestockBar.SelectedValue = model.F_LivestockBar + ""; F_ToiletType.SelectedValue = model.F_ToiletType + ""; Maticsoft.BLL.sys_User user_bll = new Maticsoft.BLL.sys_User(); Maticsoft.Model.sys_User user_model = user_bll.GetModel(model.F_UserID); F_UserID.Value = user_model.UserID + ""; F_UserID_input.Value = user_model.U_CName; Maticsoft.Model.sys_User user_model1 = user_bll.GetModel(model.F_ResponsibilityUserID); F_ResponsibilityUserID.Value = user_model1.UserID + ""; F_ResponsibilityUserID_input.Value = user_model1.U_CName; Maticsoft.Model.sys_User user_model2 = user_bll.GetModel(model.F_FillingUserID); F_FillingUserID.Value = user_model2.UserID + ""; F_FillingUserID_input.Value = user_model2.U_CName; Maticsoft.BLL.record_FamilyProblem record_FamilyProblem_bll = new Maticsoft.BLL.record_FamilyProblem(); Maticsoft.Model.record_FamilyProblem record_FamilyProblem_model = record_FamilyProblem_bll.GetModel(model.FamilyID); if (record_FamilyProblem_model != null) { F_RecordTime.Text = record_FamilyProblem_model.F_RecordTime.ToShortDateString(); F_StartTime.Text = record_FamilyProblem_model.F_StartTime.ToShortDateString(); F_endTime.Text = record_FamilyProblem_model.F_endTime.ToShortDateString(); F_OverviewProblem.Text = record_FamilyProblem_model.F_OverviewProblem.ToString(); F_DetailProblem.Text = record_FamilyProblem_model.F_DetailProblem.ToString(); Maticsoft.BLL.sys_User fillinguser_bll = new Maticsoft.BLL.sys_User(); Maticsoft.Model.sys_User fillinguser_model = fillinguser_bll.GetModel(model.F_FillingUserID); F_FillingUserID2.Value = user_model.UserID + ""; F_FillingUserID2_input.Value = user_model.U_CName; } }