示例#1
0
        protected override string uc_Update()
        {
            string str;

            if (MyRule.Get(MyLogin.RoleId, "bbiPosition") != "OK")
            {
                str = "";
            }
            else if (MyRule.AllowEdit)
            {
                //  SYS_LOG.Insert("Danh Mục Chức Vụ", "Cập Nhật", this.txtID.Text);
                base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
                DIC_POSITION dICPOSITION = new DIC_POSITION(this.txtID.Text, this.txtNAME.Text, this.chxManager.Checked, this.txtDescription.Text, this.chxUse.Checked);
                string       str1        = dICPOSITION.Update();
                if (str1 == "OK")
                {
                    this.RaiseSuccessEventHander(dICPOSITION);
                }
                if (str1 != "OK")
                {
                    XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                this.DoHide();
                str = str1;
            }
            else
            {
                MyRule.Notify();
                str = "";
            }
            return(str);
        }
示例#2
0
 public override void Change()
 {
     if (!(MyRule.Get(MyLogin.RoleId, "bbiPosition") != "OK"))
     {
         if (MyRule.AllowAccess)
         {
             DIC_POSITION dICPOSITION = new DIC_POSITION();
             object       cellValue   = base.GetCellValue(this.m_RowClickEventArgs.RowIndex, "PositionCode");
             if (cellValue != null)
             {
                 base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                 if (!(dICPOSITION.Get(cellValue.ToString()) != "OK"))
                 {
                     this.DoHide();
                     xfmPositionAdd _xfmPositionAdd = new xfmPositionAdd(Actions.Update, dICPOSITION);
                     _xfmPositionAdd.Updated += new xfmPositionAdd.UpdatedEventHander(this.frm_Updated);
                     _xfmPositionAdd.Added   += new xfmPositionAdd.AddedEventHander(this.frm_Added);
                     _xfmPositionAdd.ShowDialog();
                 }
                 else
                 {
                     this.DoHide();
                     XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
             }
         }
         else
         {
             MyRule.Notify();
         }
     }
 }
示例#3
0
        // CHUC_VU (DIC_POSITION)
        public static ENT_RETURN Check_Data(DIC_POSITION e)
        {
            ENT_RETURN ret     = new ENT_RETURN();
            string     err_msg = string.Empty;

            // BEGIN CHECK
            if (Is_Empty_String(e.PositionName))
            {
                err_msg += GLOBAL.err_code["E001"];
            }

            if (Is_Over_MaxLength(e.PositionName, 100))
            {
                err_msg += GLOBAL.err_code["E002"];
            }

            if (Is_Over_MaxLength(e.Description, 255))
            {
                err_msg += GLOBAL.err_code["E003"];
            }
            // END CHECK


            if (err_msg != string.Empty)
            {
                ret.Message = err_msg;
                ret.Status  = false;
            }

            return(ret);
        }
示例#4
0
 public void RaiseUpdatedEventHander(DIC_POSITION Item)
 {
     if (this.Updated != null)
     {
         this.Updated(this, Item);
     }
 }
示例#5
0
 private void RaiseSuccessEventHander(DIC_POSITION item)
 {
     if (this.Success != null)
     {
         this.Success(this, item);
     }
 }
示例#6
0
        protected override void Add()
        {
            base.Add();
            DIC_POSITION dICPOSITION = new DIC_POSITION();

            this.txtID.Text = dICPOSITION.NewID();
            this.txtNAME.Focus();
        }
示例#7
0
        public xfmPositionAdd(Actions Action)
        {
            this.InitializeComponent();
            this.Init();
            this.ucAdd.Status = Action;
            DIC_POSITION dICPOSITION = new DIC_POSITION();

            this.ucAdd.SetData(dICPOSITION.NewID());
            this.Text = "Thêm";
        }
示例#8
0
        private void UpdateRow(DIC_POSITION item, RowClickEventArgs e)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int rowIndex = e.RowIndex;

            advBandedGridView.SetRowCellValue(rowIndex, "Active", item.Active);
            advBandedGridView.SetRowCellValue(rowIndex, "PositionCode", item.PositionCode);
            advBandedGridView.SetRowCellValue(rowIndex, "PositionName", item.PositionName);
            advBandedGridView.SetRowCellValue(rowIndex, "IsManager", item.IsManager);
            advBandedGridView.SetRowCellValue(rowIndex, "Description", item.Description);
            advBandedGridView.UpdateCurrentRow();
        }
示例#9
0
 public void SetData(DIC_POSITION item)
 {
     this.txtID.Text = item.PositionCode;
     //   SYS_LOG.Insert("Danh Mục Chức Vụ", "Xem", this.txtID.Text);
     if (this.m_Status == Actions.Update)
     {
         this.txtID.Properties.ReadOnly = true;
     }
     this.txtNAME.Text        = item.PositionName;
     this.chxManager.Checked  = item.IsManager;
     this.txtDescription.Text = item.Description;
     this.chxUse.Checked      = item.Active;
 }
示例#10
0
        protected override string uc_Delete()
        {
            DIC_POSITION dICPOSITION = new DIC_POSITION()
            {
                PositionCode = this.txtID.Text
            };
            string str = dICPOSITION.Delete();

            if (str == "OK")
            {
                this.RaiseSuccessEventHander(dICPOSITION);
            }
            return(str);
        }
示例#11
0
        private void AddRow(DIC_POSITION Item)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int focusedRowHandle = advBandedGridView.FocusedRowHandle;

            advBandedGridView.AddNewRow();
            focusedRowHandle = advBandedGridView.FocusedRowHandle;
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Active", Item.Active);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "PositionCode", Item.PositionCode);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "PositionName", Item.PositionName);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "IsManager", Item.IsManager);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Description", Item.Description);
            advBandedGridView.UpdateCurrentRow();
        }
示例#12
0
        public static DIC_POSITION Select_Record(DIC_POSITION clsDIC_POSITIONPara)
        {
            DIC_POSITION  clsDIC_POSITION = new DIC_POSITION();
            SqlConnection connection      = Get_Connection();
            string        selectStatement
                = "SELECT "
                  + "     [PositionCode] "
                  + "    ,[PositionName] "
                  + "    ,[IsManager] "
                  + "    ,[Description] "
                  + "    ,[Active] "
                  + "FROM "
                  + "     [DIC_POSITION] "
                  + "WHERE "
                  + "     [PositionCode] = @PositionCode "
                  + "";
            SqlCommand selectCommand = new SqlCommand(selectStatement, connection);

            selectCommand.CommandType = CommandType.Text;
            selectCommand.Parameters.AddWithValue("@PositionCode", clsDIC_POSITIONPara.PositionCode);
            try
            {
                connection.Open();
                SqlDataReader reader
                    = selectCommand.ExecuteReader(CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    clsDIC_POSITION.PositionCode = System.Convert.ToString(reader["PositionCode"]);
                    clsDIC_POSITION.PositionName = reader["PositionName"] is DBNull ? null : reader["PositionName"].ToString();
                    clsDIC_POSITION.IsManager    = reader["IsManager"] is DBNull ? null : (Boolean?)reader["IsManager"];
                    clsDIC_POSITION.Description  = reader["Description"] is DBNull ? null : reader["Description"].ToString();
                    clsDIC_POSITION.Active       = reader["Active"] is DBNull ? null : (Boolean?)reader["Active"];
                }
                else
                {
                    clsDIC_POSITION = null;
                }
                reader.Close();
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(clsDIC_POSITION);
        }
示例#13
0
 public xfmPositionAdd(Actions Action, DIC_POSITION Item)
 {
     this.InitializeComponent();
     this.Init();
     this.ucAdd.Status = Action;
     if (Action == Actions.Update)
     {
         this.ucAdd.SetData(Item);
         this.Text = "Cập nhật";
     }
     else if (Action == Actions.Delete)
     {
         this.ucAdd.SetData(Item.PositionCode);
     }
 }
示例#14
0
        private void frm_EDIT_Load(object sender, EventArgs e)
        {
            old_entity = new DIC_POSITION();

            old_entity.PositionCode = CODE;
            old_entity = DAO_DIC_POSITION.Select_Record(old_entity);


            txt_POSITION_CODE.Text = old_entity.PositionCode;
            txt_POSITION_NAME.Text = old_entity.PositionName;
            txt_DESCRIPTION.Text   = old_entity.Description;
            if (old_entity.IsManager != null)
            {
                chk_IS_MANAGER.Checked = (bool)old_entity.IsManager;
            }
        }
示例#15
0
 private void ucAdd_Success(object sender, DIC_POSITION Item)
 {
     if (this.ucAdd.Status == Actions.Add)
     {
         this.RaiseAddedEventHander(Item);
     }
     else if (this.ucAdd.Status == Actions.Update)
     {
         this.RaiseUpdatedEventHander(Item);
     }
     if (this.ucAdd.IsClose == CloseOrNew.Close)
     {
         base.Close();
     }
     this.ucAdd.Clear();
 }
示例#16
0
        private void txtID_KeyDown(object sender, KeyEventArgs e)
        {
            TextEdit textEdit = (TextEdit)sender;

            if (e.KeyCode == Keys.Return | e.KeyCode == Keys.Tab)
            {
                DIC_POSITION dICPOSITION = new DIC_POSITION();
                if (this.m_Status == Actions.Add)
                {
                    if (dICPOSITION.Exist(textEdit.Text))
                    {
                        this.Err.SetError(textEdit, "Mã đã tồn tại.");
                        textEdit.Focus();
                    }
                }
            }
        }
示例#17
0
        private bool Insert()
        {
            new_entity = new DIC_POSITION();
            new_entity.PositionCode = txt_POSITION_CODE.Text;
            new_entity.PositionName = txt_POSITION_NAME.Text;
            new_entity.Description  = txt_DESCRIPTION.Text;
            new_entity.IsManager    = chk_IS_MANAGER.Checked;
            new_entity.Active       = true;

            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_POSITION.Add(new_entity);
                parent.dg_DATA.DataSource = DAO_DIC_POSITION.Get_Data();
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!"); return(false);
            }
            return(true);
        }
示例#18
0
        private void btn_SAVE_Click(object sender, EventArgs e)
        {
            new_entity = new DIC_POSITION();


            new_entity.PositionCode = txt_POSITION_CODE.Text;
            new_entity.PositionName = txt_POSITION_NAME.Text;
            new_entity.Description  = txt_DESCRIPTION.Text;
            new_entity.IsManager    = chk_IS_MANAGER.Checked;
            new_entity.Active       = old_entity.Active;
            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_POSITION.Update(old_entity, new_entity);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
            }
        }
示例#19
0
        public override void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            DIC_POSITION dICPOSITION = new DIC_POSITION();

            this.gcList.DataSource = dICPOSITION.GetList();
            base.SetWaitDialogCaption("Đang nạp cấu hình...");
            this.List_Init(this.gbList);
            base.SetWaitDialogCaption("Nạp quyền sử dụng...");
            MyRule.Get(MyLogin.RoleId, "bbiPosition");
            if (!MyRule.AllowPrint)
            {
                this.ucToolBar.bbiPrint.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiPosition");
            if (!MyRule.AllowExport)
            {
                this.ucToolBar.bbiExport.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiPosition");
            if (!MyRule.AllowAdd)
            {
                this.ucToolBar.bbiAdd.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiPosition");
            if (!MyRule.AllowDelete)
            {
                this.ucToolBar.bbiDelete.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiPosition");
            if (!MyRule.AllowEdit)
            {
                this.ucToolBar.bbiEdit.Visibility = BarItemVisibility.Never;
            }
            base.SetWaitDialogCaption("Đã xong...");
            this.DoHide();
        }
示例#20
0
        public static bool Delete(DIC_POSITION clsDIC_POSITION)
        {
            SqlConnection connection = Get_Connection();
            string        deleteStatement
                = "DELETE FROM "
                  + "     [DIC_POSITION] "
                  + "WHERE "
                  + "     [PositionCode] = @OldPositionCode "
                  + " AND ((@OldPositionName IS NULL AND [PositionName] IS NULL) OR [PositionName] = @OldPositionName) "
                  + " AND ((@OldIsManager IS NULL AND [IsManager] IS NULL) OR [IsManager] = @OldIsManager) "
                  + " AND ((@OldDescription IS NULL AND [Description] IS NULL) OR [Description] = @OldDescription) "
                  + " AND ((@OldActive IS NULL AND [Active] IS NULL) OR [Active] = @OldActive) "
                  + "";
            SqlCommand deleteCommand = new SqlCommand(deleteStatement, connection);

            deleteCommand.CommandType = CommandType.Text;
            deleteCommand.Parameters.AddWithValue("@OldPositionCode", clsDIC_POSITION.PositionCode);
            if (clsDIC_POSITION.PositionName != null)
            {
                deleteCommand.Parameters.AddWithValue("@OldPositionName", clsDIC_POSITION.PositionName);
            }
            else
            {
                deleteCommand.Parameters.AddWithValue("@OldPositionName", DBNull.Value);
            }
            if (clsDIC_POSITION.IsManager.HasValue == true)
            {
                deleteCommand.Parameters.AddWithValue("@OldIsManager", clsDIC_POSITION.IsManager);
            }
            else
            {
                deleteCommand.Parameters.AddWithValue("@OldIsManager", DBNull.Value);
            }
            if (clsDIC_POSITION.Description != null)
            {
                deleteCommand.Parameters.AddWithValue("@OldDescription", clsDIC_POSITION.Description);
            }
            else
            {
                deleteCommand.Parameters.AddWithValue("@OldDescription", DBNull.Value);
            }
            if (clsDIC_POSITION.Active.HasValue == true)
            {
                deleteCommand.Parameters.AddWithValue("@OldActive", clsDIC_POSITION.Active);
            }
            else
            {
                deleteCommand.Parameters.AddWithValue("@OldActive", DBNull.Value);
            }
            try
            {
                connection.Open();
                int count = deleteCommand.ExecuteNonQuery();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
        }
示例#21
0
        public static bool Add(DIC_POSITION clsDIC_POSITION)
        {
            SqlConnection connection = Get_Connection();
            string        insertStatement
                = "INSERT "
                  + "     [DIC_POSITION] "
                  + "     ( "
                  + "     [PositionCode] "
                  + "    ,[PositionName] "
                  + "    ,[IsManager] "
                  + "    ,[Description] "
                  + "    ,[Active] "
                  + "     ) "
                  + "VALUES "
                  + "     ( "
                  + "     @PositionCode "
                  + "    ,@PositionName "
                  + "    ,@IsManager "
                  + "    ,@Description "
                  + "    ,@Active "
                  + "     ) "
                  + "";
            SqlCommand insertCommand = new SqlCommand(insertStatement, connection);

            insertCommand.CommandType = CommandType.Text;
            insertCommand.Parameters.AddWithValue("@PositionCode", clsDIC_POSITION.PositionCode);
            if (clsDIC_POSITION.PositionName != null)
            {
                insertCommand.Parameters.AddWithValue("@PositionName", clsDIC_POSITION.PositionName);
            }
            else
            {
                insertCommand.Parameters.AddWithValue("@PositionName", DBNull.Value);
            }
            if (clsDIC_POSITION.IsManager.HasValue == true)
            {
                insertCommand.Parameters.AddWithValue("@IsManager", clsDIC_POSITION.IsManager);
            }
            else
            {
                insertCommand.Parameters.AddWithValue("@IsManager", DBNull.Value);
            }
            if (clsDIC_POSITION.Description != null)
            {
                insertCommand.Parameters.AddWithValue("@Description", clsDIC_POSITION.Description);
            }
            else
            {
                insertCommand.Parameters.AddWithValue("@Description", DBNull.Value);
            }
            if (clsDIC_POSITION.Active.HasValue == true)
            {
                insertCommand.Parameters.AddWithValue("@Active", clsDIC_POSITION.Active);
            }
            else
            {
                insertCommand.Parameters.AddWithValue("@Active", DBNull.Value);
            }
            try
            {
                connection.Open();
                int count = insertCommand.ExecuteNonQuery();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
        }
示例#22
0
        public override void Delete()
        {
            object cellValue;

            if (!(MyRule.Get(MyLogin.RoleId, "bbiPosition") != "OK"))
            {
                if (MyRule.AllowDelete)
                {
                    if (ClsOption.System2.IsQuestion)
                    {
                        if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            return;
                        }
                    }
                    base.SetWaitDialogCaption("Đang xóa...");
                    string            str  = "";
                    bool              flag = false;
                    AdvBandedGridView advBandedGridView = this.gbList;
                    int[]             selectedRows      = advBandedGridView.GetSelectedRows();
                    DIC_POSITION      dICPOSITION       = new DIC_POSITION();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag      = true;
                        cellValue = base.GetCellValue(selectedRows[i - 1], "PositionCode");
                        if (cellValue != null)
                        {
                            // SYS_LOG.Insert("Danh Mục Chức Vụ", "Xoá", cellValue.ToString());
                            str = dICPOSITION.Delete(cellValue.ToString());
                            if (str == "OK")
                            {
                                advBandedGridView.DeleteRow(selectedRows[i - 1]);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show(string.Concat("Thông tin không được xóa\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        if (advBandedGridView.DataSource != null)
                        {
                            RowClickEventArgs rowClickEventArg = new RowClickEventArgs((advBandedGridView == null ? -1 : advBandedGridView.FocusedRowHandle), (advBandedGridView.FocusedColumn == null ? -1 : advBandedGridView.FocusedColumn.ColumnHandle), (advBandedGridView.FocusedColumn == null ? "" : advBandedGridView.FocusedColumn.FieldName));
                            this.m_RowClickEventArgs = rowClickEventArg;
                            cellValue = null;
                            cellValue = base.GetCellValue(rowClickEventArg.RowIndex, "PositionCode");
                            if (cellValue != null)
                            {
                                //  SYS_LOG.Insert("Danh Mục Chức Vụ", "Xoá", cellValue.ToString());
                                base.SetWaitDialogCaption("Đang xóa...");
                                str = dICPOSITION.Delete(cellValue.ToString());
                                if (str == "OK")
                                {
                                    advBandedGridView.DeleteRow(rowClickEventArg.RowIndex);
                                }
                                else if (str != "OK")
                                {
                                    MessageBox.Show(string.Concat("Thông tin không được xóa\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                }
                                this.DoHide();
                            }
                        }
                    }
                }
                else
                {
                    MyRule.Notify();
                }
            }
        }
示例#23
0
 private void frm_Updated(object sender, DIC_POSITION Item)
 {
     this.UpdateRow(Item, this.m_RowClickEventArgs);
 }
示例#24
0
 private void frm_Added(object sender, DIC_POSITION e)
 {
     this.AddRow(e);
 }
示例#25
0
        public static bool Update(DIC_POSITION oldDIC_POSITION,
                                  DIC_POSITION newDIC_POSITION)
        {
            SqlConnection connection = Get_Connection();
            string        updateStatement
                = "UPDATE "
                  + "     [DIC_POSITION] "
                  + "SET "
                  + "     [PositionCode] = @NewPositionCode "
                  + "    ,[PositionName] = @NewPositionName "
                  + "    ,[IsManager] = @NewIsManager "
                  + "    ,[Description] = @NewDescription "
                  + "    ,[Active] = @NewActive "
                  + "WHERE "
                  + "     [PositionCode] = @OldPositionCode "
                  + " AND ((@OldPositionName IS NULL AND [PositionName] IS NULL) OR [PositionName] = @OldPositionName) "
                  + " AND ((@OldIsManager IS NULL AND [IsManager] IS NULL) OR [IsManager] = @OldIsManager) "
                  + " AND ((@OldDescription IS NULL AND [Description] IS NULL) OR [Description] = @OldDescription) "
                  + " AND ((@OldActive IS NULL AND [Active] IS NULL) OR [Active] = @OldActive) "
                  + "";
            SqlCommand updateCommand = new SqlCommand(updateStatement, connection);

            updateCommand.CommandType = CommandType.Text;
            updateCommand.Parameters.AddWithValue("@NewPositionCode", newDIC_POSITION.PositionCode);
            if (newDIC_POSITION.PositionName != null)
            {
                updateCommand.Parameters.AddWithValue("@NewPositionName", newDIC_POSITION.PositionName);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@NewPositionName", DBNull.Value);
            }
            if (newDIC_POSITION.IsManager.HasValue == true)
            {
                updateCommand.Parameters.AddWithValue("@NewIsManager", newDIC_POSITION.IsManager);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@NewIsManager", DBNull.Value);
            }
            if (newDIC_POSITION.Description != null)
            {
                updateCommand.Parameters.AddWithValue("@NewDescription", newDIC_POSITION.Description);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@NewDescription", DBNull.Value);
            }
            if (newDIC_POSITION.Active.HasValue == true)
            {
                updateCommand.Parameters.AddWithValue("@NewActive", newDIC_POSITION.Active);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@NewActive", DBNull.Value);
            }
            updateCommand.Parameters.AddWithValue("@OldPositionCode", oldDIC_POSITION.PositionCode);
            if (oldDIC_POSITION.PositionName != null)
            {
                updateCommand.Parameters.AddWithValue("@OldPositionName", oldDIC_POSITION.PositionName);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@OldPositionName", DBNull.Value);
            }
            if (oldDIC_POSITION.IsManager.HasValue == true)
            {
                updateCommand.Parameters.AddWithValue("@OldIsManager", oldDIC_POSITION.IsManager);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@OldIsManager", DBNull.Value);
            }
            if (oldDIC_POSITION.Description != null)
            {
                updateCommand.Parameters.AddWithValue("@OldDescription", oldDIC_POSITION.Description);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@OldDescription", DBNull.Value);
            }
            if (oldDIC_POSITION.Active.HasValue == true)
            {
                updateCommand.Parameters.AddWithValue("@OldActive", oldDIC_POSITION.Active);
            }
            else
            {
                updateCommand.Parameters.AddWithValue("@OldActive", DBNull.Value);
            }
            try
            {
                connection.Open();
                int count = updateCommand.ExecuteNonQuery();
                if (count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }
        }