/// <summary> /// 保存按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { string strRowID = hfFormID.Text; Model.Base_SpecialSchemeType newSpecialSchemeType = new Model.Base_SpecialSchemeType { SpecialSchemeTypeCode = this.txtSpecialSchemeTypeCode.Text.Trim(), SpecialSchemeTypeName = this.txtSpecialSchemeTypeName.Text.Trim(), Remark = txtRemark.Text.Trim() }; if (string.IsNullOrEmpty(strRowID)) { newSpecialSchemeType.SpecialSchemeTypeId = SQLHelper.GetNewID(typeof(Model.Base_SpecialSchemeType)); BLL.SpecialSchemeTypeService.AddSpecialSchemeType(newSpecialSchemeType); BLL.LogService.AddSys_Log(this.CurrUser, newSpecialSchemeType.SpecialSchemeTypeCode, newSpecialSchemeType.SpecialSchemeTypeId, BLL.Const.SpecialSchemeTypeMenuId, BLL.Const.BtnAdd); } else { newSpecialSchemeType.SpecialSchemeTypeId = strRowID; BLL.SpecialSchemeTypeService.UpdateSpecialSchemeType(newSpecialSchemeType); BLL.LogService.AddSys_Log(this.CurrUser, newSpecialSchemeType.SpecialSchemeTypeCode, newSpecialSchemeType.SpecialSchemeTypeId, BLL.Const.SpecialSchemeTypeMenuId, BLL.Const.BtnModify); } this.SimpleForm1.Reset(); // 重新绑定表格,并点击当前编辑或者新增的行 BindGrid(); PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, newSpecialSchemeType.SpecialSchemeTypeId)); }
/// <summary> /// 根据主键删除信息 /// </summary> /// <param name="specialSchemeTypeId"></param> public static void DeleteSpecialSchemeTypeById(string specialSchemeTypeId) { Model.SUBHSSEDB db = Funs.DB; Model.Base_SpecialSchemeType specialSchemeType = db.Base_SpecialSchemeType.FirstOrDefault(e => e.SpecialSchemeTypeId == specialSchemeTypeId); { db.Base_SpecialSchemeType.DeleteOnSubmit(specialSchemeType); db.SubmitChanges(); } }
/// <summary> /// 修改 /// </summary> /// <param name="teamGroup"></param> public static void UpdateSpecialSchemeType(Model.Base_SpecialSchemeType specialSchemeType) { Model.SUBHSSEDB db = Funs.DB; Model.Base_SpecialSchemeType newSpecialSchemeType = db.Base_SpecialSchemeType.FirstOrDefault(e => e.SpecialSchemeTypeId == specialSchemeType.SpecialSchemeTypeId); if (newSpecialSchemeType != null) { newSpecialSchemeType.SpecialSchemeTypeCode = specialSchemeType.SpecialSchemeTypeCode; newSpecialSchemeType.SpecialSchemeTypeName = specialSchemeType.SpecialSchemeTypeName; newSpecialSchemeType.Remark = specialSchemeType.Remark; db.SubmitChanges(); } }
/// <summary> /// 添加 /// </summary> /// <param name="?"></param> public static void AddSpecialSchemeType(Model.Base_SpecialSchemeType specialSchemeType) { Model.SUBHSSEDB db = Funs.DB; Model.Base_SpecialSchemeType newSpecialSchemeType = new Model.Base_SpecialSchemeType { SpecialSchemeTypeId = specialSchemeType.SpecialSchemeTypeId, SpecialSchemeTypeCode = specialSchemeType.SpecialSchemeTypeCode, SpecialSchemeTypeName = specialSchemeType.SpecialSchemeTypeName, Remark = specialSchemeType.Remark }; db.Base_SpecialSchemeType.InsertOnSubmit(newSpecialSchemeType); db.SubmitChanges(); }