Example #1
0
 /// <summary>
 /// 根据主键删除专项检查类型
 /// </summary>
 /// <param name="checkItemSetId"></param>
 public static void DeleteCheckItemSetById(string checkItemSetId)
 {
     Model.HSSE_Check_CheckItemSet checkItemSet = db.HSSE_Check_CheckItemSet.FirstOrDefault(e => e.CheckItemSetId == checkItemSetId);
     if (checkItemSet != null)
     {
         db.HSSE_Check_CheckItemSet.DeleteOnSubmit(checkItemSet);
         db.SubmitChanges();
     }
 }
Example #2
0
 /// <summary>
 /// 添加专项检查
 /// </summary>
 /// <param name="checkItemSet"></param>
 public static void AddCheckItemSet(Model.HSSE_Check_CheckItemSet checkItemSet)
 {
     Model.HSSE_Check_CheckItemSet newCheckItemSet = new Model.HSSE_Check_CheckItemSet();
     newCheckItemSet.CheckItemSetId = checkItemSet.CheckItemSetId;
     newCheckItemSet.CheckItemName  = checkItemSet.CheckItemName;
     newCheckItemSet.SupCheckItem   = checkItemSet.SupCheckItem;
     newCheckItemSet.MapCode        = checkItemSet.MapCode;
     newCheckItemSet.IsEndLever     = checkItemSet.IsEndLever;
     newCheckItemSet.SortIndex      = checkItemSet.SortIndex;
     newCheckItemSet.IsBuiltIn      = checkItemSet.IsBuiltIn;
     db.HSSE_Check_CheckItemSet.InsertOnSubmit(newCheckItemSet);
     db.SubmitChanges();
 }
Example #3
0
 /// <summary>
 /// 修改专项检查
 /// </summary>
 /// <param name="checkItemSet"></param>
 public static void UpdateCheckItemSet(Model.HSSE_Check_CheckItemSet checkItemSet)
 {
     Model.HSSE_Check_CheckItemSet newCheckItemSet = db.HSSE_Check_CheckItemSet.FirstOrDefault(e => e.CheckItemSetId == checkItemSet.CheckItemSetId);
     if (newCheckItemSet != null)
     {
         newCheckItemSet.CheckItemName = checkItemSet.CheckItemName;
         newCheckItemSet.SupCheckItem  = checkItemSet.SupCheckItem;
         newCheckItemSet.MapCode       = checkItemSet.MapCode;
         newCheckItemSet.IsEndLever    = checkItemSet.IsEndLever;
         newCheckItemSet.SortIndex     = checkItemSet.SortIndex;
         newCheckItemSet.IsBuiltIn     = checkItemSet.IsBuiltIn;
         db.SubmitChanges();
     }
 }
Example #4
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string staName = this.txtCheckItemName.Text.Trim();

            if (!string.IsNullOrEmpty(staName))
            {
                if (!BLL.CheckItemSetService.IsExistCheckItemName(this.CheckItemSetId, this.SupCheckItem, staName))
                {
                    Model.HSSE_Check_CheckItemSet checkItemSet = new Model.HSSE_Check_CheckItemSet
                    {
                        CheckItemName = staName,
                        SupCheckItem  = this.SupCheckItem,
                        MapCode       = this.txtMapCode.Text.Trim(),
                        SortIndex     = Funs.GetNewIntOrZero(this.txtSortIndex.Text.Trim()),
                        IsEndLever    = Convert.ToBoolean(this.chkIsEndLevel.Checked)
                    };
                    if (string.IsNullOrEmpty(this.CheckItemSetId))
                    {
                        checkItemSet.CheckItemSetId = SQLHelper.GetNewID(typeof(Model.HSSE_Check_CheckItemSet));
                        BLL.CheckItemSetService.AddCheckItemSet(checkItemSet);
                        BLL.LogService.AddSys_Log(this.CurrUser, checkItemSet.MapCode, checkItemSet.CheckItemSetId, BLL.Const.SpecialCheckTypesMenuId, BLL.Const.BtnAdd);
                    }
                    else
                    {
                        checkItemSet.CheckItemSetId = this.CheckItemSetId;
                        BLL.CheckItemSetService.UpdateCheckItemSet(checkItemSet);
                        BLL.LogService.AddSys_Log(this.CurrUser, checkItemSet.MapCode, checkItemSet.CheckItemSetId, BLL.Const.SpecialCheckTypesMenuId, BLL.Const.BtnModify);
                    }
                }
                else
                {
                    Alert.ShowInTop("检查项目名称已存在!", MessageBoxIcon.Warning);
                    return;
                }

                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                Alert.ShowInTop("检查项目名称不能为空!", MessageBoxIcon.Warning);
                return;
            }
        }