Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
 private void frm_EDIT_Load(object sender, EventArgs e)
 {
     old_entity = new DIC_PROFESSIONAL();
     old_entity.ProfessionalCode = CODE;
     old_entity = DAO_DIC_PROFESSIONAL.Select_Record(old_entity);
     txt_PROFESSIONAL_CODE.Text = old_entity.ProfessionalCode;
     txt_PROFESSIONAL_NAME.Text = old_entity.ProfessionalName;
     txt_DESCRIPTION.Text       = old_entity.Description;
 }
Exemplo n.º 3
0
 //DataTable dt_RELIGION = null;
 private void Init_Reference_Data()
 {
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_RELIGION, DAO_DIC_RELIGION.Get_View_Data(), "Mã Tôn Giáo", "Tên Tôn Giáo");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_NATIONALITY, DAO_DIC_NATIONALITY.Get_View_Data(), "Mã Quốc Tịch", "Tên Quốc Tịch");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_ETHNIC, DAO_DIC_ETHNIC.Get_View_Data(), "Mã Dân Tộc", "Tên Dân Tộc");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_LANGUAGE, DAO_DIC_LANGUAGE.Get_View_Data(), "Mã Ngôn Ngữ", "Tên Ngôn Ngữ");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_INFORMATIC, DAO_DIC_INFORMATIC.Get_View_Data(), "Mã Bằng Tin Học", "Tên Bằng Tin Học");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_PROFESSIONAL, DAO_DIC_PROFESSIONAL.Get_View_Data(), "Mã Chuyên Môn", "Tên Chuyên Môn");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_SCHOOL, DAO_DIC_SCHOOL.Get_View_Data(), "Mã Trường", "Tên Trường");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_EDUCATION, DAO_DIC_EDUCATION.Get_View_Data(), "Mã Học Vấn", "Tên Học Vấn");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_DEPARTMENT, DAO_DIC_DEPARTMENT.Get_View_Data(), "Mã Phòng Ban", "Tên Phòng Ban");
     LOGIC_COMMON.Init_Lookup_Edit_DataSource(cbo_WORK_STATE, DAO_DIC_WORK_STATE.Get_View_Data(), "Mã Trạng Thái", "Tên Trạng Thái");
 }
Exemplo n.º 4
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");
            }
        }
Exemplo n.º 5
0
        void edit_record(object sender, EventArgs e)
        {
            DataRowView current_row = (DataRowView)gv_DATA.GetFocusedRow();

            if (current_row == null)
            {
                return;
            }
            string row_code = current_row.Row.ItemArray[0].ToString();
            frm_CHUYEN_MON_EDIT frm_edit = new frm_CHUYEN_MON_EDIT(row_code);

            if (frm_edit.ShowDialog() == DialogResult.OK)
            {
                dg_DATA.DataSource = DAO_DIC_PROFESSIONAL.Get_Data();
                int rowHandle = gv_DATA.LocateByValue(column_code, row_code);
                if (rowHandle != DevExpress.XtraGrid.GridControl.InvalidRowHandle)
                {
                    gv_DATA.FocusedRowHandle = rowHandle;
                }
            }
        }
Exemplo n.º 6
0
        void delete_record(object sender, EventArgs e)
        {
            DataRowView current_row = (DataRowView)gv_DATA.GetFocusedRow();

            if (current_row == null)
            {
                return;
            }
            string       row_code = current_row.Row.ItemArray[0].ToString();
            DialogResult dlg      = XtraMessageBox.Show("Bạn có chắc xóa mã : " + row_code + "?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (dlg == DialogResult.Yes)
            {
                int rowHandle = gv_DATA.LocateByValue(column_code, row_code);

                DAO_DIC_PROFESSIONAL.Delete(row_code);
                dg_DATA.DataSource = DAO_DIC_PROFESSIONAL.Get_Data();

                if (rowHandle != DevExpress.XtraGrid.GridControl.InvalidRowHandle)
                {
                    gv_DATA.FocusedRowHandle = Math.Min(rowHandle, gv_DATA.DataRowCount - 1);
                }
            }
        }
Exemplo n.º 7
0
 void frm_Load(object sender, EventArgs e)
 {
     dg_DATA.DataSource = DAO_DIC_PROFESSIONAL.Get_Data();
 }