예제 #1
0
        private bool Insert()
        {
            new_entity = new DIC_INFORMATIC();
            new_entity.InformaticCode = txt_INFORMATIC_CODE.Text;
            new_entity.InformaticName = txt_INFORMATIC_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_INFORMATIC.Add(new_entity);
                if (parent != null)
                {
                    parent.dg_DATA.DataSource = DAO_DIC_INFORMATIC.Get_Data();
                }
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi..!!!");
                return(false);
            }
            return(true);
        }
예제 #2
0
        private bool Insert()
        {
            new_entity = new DIC_DEPARTMENT();
            new_entity.DepartmentCode = txt_DEPARTMENT_CODE.Text;
            new_entity.DepartmentName = txt_DEPARTMENT_NAME.Text;
            new_entity.Description    = txt_DESCRIPTION.Text;
            new_entity.Phone          = txt_PHONE.Text;
            new_entity.Quantity       = 0;
            new_entity.FactQuantity   = 0;
            new_entity.Active         = true;
            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_DEPARTMENT.Add(new_entity);
                parent.dg_DATA.DataSource = DAO_DIC_DEPARTMENT.Get_Data();
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");

                return(false);
            }
            return(true);
        }
예제 #3
0
        private bool Insert()
        {
            new_entity = new DIC_PROFESSIONAL();
            new_entity.ProfessionalCode = txt_PROFESSIONAL_CODE.Text;
            new_entity.ProfessionalName = txt_PROFESSIONAL_NAME.Text;
            new_entity.Description      = txt_DESCRIPTION.Text;
            new_entity.Active           = true;

            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_PROFESSIONAL.Add(new_entity);
                if (parent != null)
                {
                    parent.dg_DATA.DataSource = DAO_DIC_PROFESSIONAL.Get_Data();
                }
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Loi");
                return(false);
            }
            return(true);
        }
예제 #4
0
        private void btn_SAVE_Click(object sender, EventArgs e)
        {
            new_entity = new HRM_EMPLOYEE();
            new_entity.EmployeeCode   = txt_EMPLOYEE_CODE.Text;
            new_entity.FirstName      = txt_FIRST_NAME.Text;
            new_entity.LastName       = txt_LAST_NAME.Text;
            new_entity.Sex            = chk_SEX.Checked;
            new_entity.Birthday       = date_BIRTHDAY.DateTime;
            new_entity.BirthPlace     = txt_BIRTH_PLACE.Text;
            new_entity.Alias          = txt_ALIAS.Text;
            new_entity.Marriage       = (cbo_MARRIAGE.EditValue == null ? "" : cbo_MARRIAGE.EditValue.ToString());
            new_entity.IDCard         = txt_IDCARD.Text;
            new_entity.DepartmentCode = cbo_DEPARTMENT.EditValue.ToString();
            new_entity.WorkStateCode  = (cbo_WORK_STATE.EditValue == null ? null : cbo_WORK_STATE.EditValue.ToString());
            new_entity.IDCardDate     = date_IDCARD.DateTime;
            new_entity.IDCardPlace    = txt_IDCARD_PLACE.Text;
            new_entity.MainAddress    = txt_MAIN_ADDRESS.Text;
            new_entity.ContactAddress = txt_CONTACT_ADDRESS.Text;
            new_entity.CellPhone      = txt_CELL_PHONE.Text;
            new_entity.Email          = txt_EMAIL.Text;
            new_entity.Nationality    = cbo_NATIONALITY.EditValue.ToString();
            new_entity.Religion       = (cbo_RELIGION.EditValue == null ?  null : cbo_RELIGION.EditValue.ToString());
            new_entity.Ethnic         = (cbo_ETHNIC.EditValue == null ? null : cbo_ETHNIC.EditValue.ToString());
            new_entity.Education      = (cbo_EDUCATION.EditValue == null ? null : cbo_EDUCATION.EditValue.ToString());
            new_entity.Language       = (cbo_LANGUAGE.EditValue == null ? null : cbo_LANGUAGE.EditValue.ToString());
            new_entity.Informatic     = (cbo_INFORMATIC.EditValue == null ? null : cbo_INFORMATIC.EditValue.ToString());
            new_entity.Professional   = (cbo_PROFESSIONAL.EditValue == null ? null : cbo_PROFESSIONAL.EditValue.ToString());
            new_entity.School         = (cbo_SCHOOL.EditValue == null ? null : cbo_SCHOOL.EditValue.ToString());

            // HOP DONG LAO DONG
            new_entity.ContractFromDate = old_entity.ContractFromDate;
            new_entity.ContractSignDate = old_entity.ContractSignDate;
            new_entity.ContractToDate   = old_entity.ContractToDate;


            if (pic_PHOTO.Image != null)
            {
                new_entity.Photo = LOGIC_COMMON.Bitmap_To_Byte(pic_PHOTO.Image);
            }

            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_HRM_EMPLOYEE.Update(old_entity, new_entity);
                DAO_DIC_DEPARTMENT.Update_Quanlity(old_entity.DepartmentCode);
                DAO_DIC_DEPARTMENT.Update_Quanlity(new_entity.DepartmentCode);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
            }
        }
예제 #5
0
        private bool Insert()
        {
            new_entity = new HRM_EMPLOYEE();
            new_entity.EmployeeCode   = txt_EMPLOYEE_CODE.Text;
            new_entity.FirstName      = txt_FIRST_NAME.Text;
            new_entity.LastName       = txt_LAST_NAME.Text;
            new_entity.Sex            = chk_SEX.Checked;
            new_entity.IDCard         = txt_IDCARD.Text;
            new_entity.Birthday       = date_BIRTHDAY.DateTime;
            new_entity.BirthPlace     = txt_BIRTH_PLACE.Text;
            new_entity.Marriage       = (cbo_MARRIAGE.EditValue == null ? "" : cbo_MARRIAGE.EditValue.ToString());
            new_entity.IDCardDate     = date_IDCARD.DateTime;
            new_entity.IDCardPlace    = txt_IDCARD_PLACE.Text;
            new_entity.MainAddress    = txt_MAIN_ADDRESS.Text;
            new_entity.ContactAddress = txt_CONTACT_ADDRESS.Text;
            new_entity.CellPhone      = txt_CELL_PHONE.Text;
            new_entity.Email          = txt_EMAIL.Text;
            new_entity.Photo          = LOGIC_COMMON.Bitmap_To_Byte(pic_PHOTO.Image);
            new_entity.Language       = (cbo_LANGUAGE.EditValue == null ? "" : cbo_LANGUAGE.EditValue.ToString());
            new_entity.Education      = (cbo_EDUCATION.EditValue == null ? "" : cbo_EDUCATION.EditValue.ToString());
            new_entity.Professional   = (cbo_PROFESSIONAL.EditValue == null ? "" : cbo_PROFESSIONAL.EditValue.ToString());
            new_entity.Nationality    = (cbo_NATIONALITY.EditValue == null ? "":cbo_NATIONALITY.EditValue.ToString());
            new_entity.Ethnic         = (cbo_ETHNIC.EditValue == null ? "" : cbo_ETHNIC.EditValue.ToString());
            new_entity.Religion       = (cbo_RELIGION.EditValue == null ? "" : cbo_RELIGION.EditValue.ToString());
            new_entity.School         = (cbo_SCHOOL.EditValue == null ? "" : cbo_SCHOOL.EditValue.ToString());
            new_entity.WorkStateCode  = (cbo_WORK_STATE.EditValue == null ? null : cbo_WORK_STATE.EditValue.ToString());
            new_entity.DepartmentCode = (cbo_DEPARTMENT.EditValue == null ? null : cbo_DEPARTMENT.EditValue.ToString());

            // HOP DONG LAO DONG
            DateTime frmDate = DateTime.Now;
            DateTime endDate = frmDate.AddYears(2);

            new_entity.ContractFromDate = (DateTime?)frmDate;
            new_entity.ContractSignDate = (DateTime?)frmDate;
            new_entity.ContractToDate   = (DateTime?)endDate;



            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_HRM_EMPLOYEE.Add(new_entity);
                DAO_DIC_DEPARTMENT.Update_Quanlity(new_entity.DepartmentCode);
                parent.dg_DATA.DataSource = DAO_HRM_EMPLOYEE.Get_Data();
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
                return(false);
            }
            return(true);
        }
예제 #6
0
        private void btn_SAVE_Click(object sender, EventArgs e)
        {
            new_entity             = new DIC_ETHNIC();
            new_entity.EthnicCode  = txt_ETHNIC_CODE.Text;
            new_entity.EthnicName  = txt_ETHNIC_NAME.Text;
            new_entity.Description = txt_DESCRIPTION.Text;
            new_entity.Active      = old_entity.Active;
            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_ETHNIC.Update(old_entity, new_entity);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
            }
        }
예제 #7
0
        private void btn_SAVE_Click(object sender, EventArgs e)
        {
            new_entity = new DIC_PROFESSIONAL();
            new_entity.ProfessionalCode = txt_PROFESSIONAL_CODE.Text;
            new_entity.ProfessionalName = txt_PROFESSIONAL_NAME.Text;
            new_entity.Description      = txt_DESCRIPTION.Text;
            new_entity.Active           = old_entity.Active;

            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_PROFESSIONAL.Update(old_entity, new_entity);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Loi");
            }
        }
예제 #8
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.!!!");
            }
        }
예제 #9
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);
        }
예제 #10
0
        private void btn_SAVE_Click(object sender, EventArgs e)
        {
            new_entity = new DIC_DEPARTMENT();


            new_entity.DepartmentCode = txt_DEPARTMENT_CODE.Text;
            new_entity.DepartmentName = txt_DEPARTMENT_NAME.Text;
            new_entity.Description    = txt_DESCRIPTION.Text;
            new_entity.Phone          = txt_PHONE.Text;
            new_entity.Quantity       = old_entity.Quantity;
            new_entity.FactQuantity   = old_entity.FactQuantity;
            new_entity.Active         = old_entity.Active;
            ENT_RETURN validate = LOGIC_CHECK.Check_Data(new_entity);

            if (validate.Status)
            {
                DAO_DIC_DEPARTMENT.Update(old_entity, new_entity);
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show(validate.Message, "Lỗi.!!!");
            }
        }