Ejemplo n.º 1
0
        /// <summary>
        /// 删除
        /// </summary>
        public override void EntityDelete()
        {
            WOFollowStepRule rule   = new WOFollowStepRule();
            WOFollowStep     entity = EntityGet();

            rule.RDelete(entity);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private WOFollowStep EntityGet()
        {
            WOFollowStep entity = new WOFollowStep();

            entity.ID = HTDataID;
            return(entity);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Delete(BaseEntity p_Entity)
        {
            try
            {
                WOFollowStep MasterEntity = (WOFollowStep)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //删除主表数据
                string Sql = "";
                Sql = "DELETE FROM Enum_WOFollowStep WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID);
                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(Sql);
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(Sql);
                }

                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int AddNew(BaseEntity p_Entity)
        {
            try
            {
                WOFollowStep MasterEntity = (WOFollowStep)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //新增主表数据
                StringBuilder MasterField = new StringBuilder();
                StringBuilder MasterValue = new StringBuilder();
                MasterField.Append("INSERT INTO Enum_WOFollowStep(");
                MasterValue.Append(" VALUES(");
                MasterField.Append("ID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ",");
                MasterField.Append("WOFollowTypeID" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.WOFollowTypeID) + ",");
                MasterField.Append("Code" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Code) + ",");
                MasterField.Append("Name" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Name) + ",");
                MasterField.Append("ColorStr" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.ColorStr) + ",");
                MasterField.Append("MainFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.MainFlag) + ",");
                MasterField.Append("SubFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.SubFlag) + ",");
                MasterField.Append("SubUpdateMainFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.SubUpdateMainFlag) + ",");
                MasterField.Append("GnsUpdateSubFlag" + ",");
                MasterValue.Append(SysString.ToDBString(MasterEntity.GnsUpdateSubFlag) + ",");
                MasterField.Append("Remark" + ")");
                MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ")");



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            WOFollowStepRule rule   = new WOFollowStepRule();
            WOFollowStep     entity = EntityGet();

            rule.RAdd(entity);
            return(entity.ID);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Update(BaseEntity p_Entity)
        {
            try
            {
                WOFollowStep MasterEntity = (WOFollowStep)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //更新主表数据
                StringBuilder UpdateBuilder = new StringBuilder();
                UpdateBuilder.Append("UPDATE Enum_WOFollowStep SET ");
                UpdateBuilder.Append(" ID=" + SysString.ToDBString(MasterEntity.ID) + ",");
                UpdateBuilder.Append(" WOFollowTypeID=" + SysString.ToDBString(MasterEntity.WOFollowTypeID) + ",");
                UpdateBuilder.Append(" Code=" + SysString.ToDBString(MasterEntity.Code) + ",");
                UpdateBuilder.Append(" Name=" + SysString.ToDBString(MasterEntity.Name) + ",");
                UpdateBuilder.Append(" ColorStr=" + SysString.ToDBString(MasterEntity.ColorStr) + ",");
                UpdateBuilder.Append(" MainFlag=" + SysString.ToDBString(MasterEntity.MainFlag) + ",");
                UpdateBuilder.Append(" SubFlag=" + SysString.ToDBString(MasterEntity.SubFlag) + ",");
                UpdateBuilder.Append(" SubUpdateMainFlag=" + SysString.ToDBString(MasterEntity.SubUpdateMainFlag) + ",");
                UpdateBuilder.Append(" GnsUpdateSubFlag=" + SysString.ToDBString(MasterEntity.GnsUpdateSubFlag) + ",");
                UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark));

                UpdateBuilder.Append(" WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID));



                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString());
                }
                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E);
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="p_BE">要删除的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RDelete(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         WOFollowStep    entity  = (WOFollowStep)p_BE;
         WOFollowStepCtl control = new WOFollowStepCtl(sqlTrans);
         control.Delete(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private WOFollowStep EntityGet()
        {
            WOFollowStep entity = new WOFollowStep();

            entity.ID = HTDataID;
            entity.SelectByID();
            entity.WOFollowTypeID    = SysConvert.ToInt32(drpWOFollowTypeID.EditValue);
            entity.Code              = txtCode.Text.Trim();
            entity.Name              = txtName.Text.Trim();
            entity.ColorStr          = txtColorStr.Text.Trim();
            entity.MainFlag          = SysConvert.ToInt32(txtMainFlag.Text.Trim());
            entity.SubFlag           = SysConvert.ToInt32(txtSubFlag.Text.Trim());
            entity.SubUpdateMainFlag = SysConvert.ToInt32(txtSubUpdateMainFlag.Text.Trim());
            entity.GnsUpdateSubFlag  = SysConvert.ToInt32(txtGnsUpdateSubFlag.Text.Trim());
            entity.Remark            = txtRemark.Text.Trim();

            return(entity);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 新增(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         WOFollowStep    entity  = (WOFollowStep)p_BE;
         WOFollowStepCtl control = new WOFollowStepCtl(sqlTrans);
         entity.ID = (int)EntityIDTable.GetID((long)SysEntity.Enum_WOFollowStep, sqlTrans);
         control.AddNew(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 设置
        /// </summary>
        public override void EntitySet()
        {
            WOFollowStep entity = new WOFollowStep();

            entity.ID = HTDataID;
            bool findFlag = entity.SelectByID();

            drpWOFollowTypeID.EditValue = entity.WOFollowTypeID;
            txtCode.Text              = entity.Code.ToString();
            txtName.Text              = entity.Name.ToString();
            txtColorStr.Text          = entity.ColorStr.ToString();
            txtMainFlag.Text          = entity.MainFlag.ToString();
            txtSubFlag.Text           = entity.SubFlag.ToString();
            txtSubUpdateMainFlag.Text = entity.SubUpdateMainFlag.ToString();
            txtGnsUpdateSubFlag.Text  = entity.GnsUpdateSubFlag.ToString();
            txtRemark.Text            = entity.Remark.ToString();


            if (!findFlag)
            {
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 检查将要操作的数据是否符合业务规则
 /// </summary>
 /// <param name="p_BE"></param>
 private void CheckCorrect(BaseEntity p_BE)
 {
     WOFollowStep entity = (WOFollowStep)p_BE;
 }