Beispiel #1
0
        private void frm_SQL_TEST_Load(object sender, EventArgs e)
        {
            //ENTITY.DIC_DEGREE entity = new ENTITY.DIC_DEGREE();
            //entity.DegreeCode = "BC000001";
            //entity = DAO_DIC_DEGREE.Select_Record(entity);
            //MessageBox.Show(entity.DegreeCode+"    sss" + entity.DegreeName);

            //ENTITY.DIC_EDUCATION entity = new ENTITY.DIC_EDUCATION();
            //entity.EducationCode = "HV000001";
            //entity = DAO_DIC_EDUCATION.Select_Record(entity);
            //MessageBox.Show(entity.EducationName);

            //ENTITY.DIC_ETHNIC entity = new ENTITY.DIC_ETHNIC();
            //entity.EthnicCode = "DT000001";
            //entity = DAO_DIC_ETHNIC.Select_Record(entity);
            //MessageBox.Show(entity.EthnicName);

            //ENTITY.DIC_INFORMATIC entity = new ENTITY.DIC_INFORMATIC();
            //entity.InformaticCode = "TH000001";
            //entity = DAO_DIC_INFORMATIC.Select_Record(entity);
            //MessageBox.Show(entity.InformaticName);

            //ENTITY.DIC_LANGUAGE entity = new ENTITY.DIC_LANGUAGE();
            //entity.LanguageCode = "NN000001";
            //entity = DAO_DIC_LANGUAGE.Select_Record(entity);
            //MessageBox.Show(entity.LanguageName);

            ENTITY.DIC_POSITION entity = new ENTITY.DIC_POSITION();
            entity.PositionCode = "CV000001";
            entity = DAO_DIC_POSITION.Select_Record(entity);
            MessageBox.Show(entity.PositionName);
        }
Beispiel #2
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;
            }
        }
Beispiel #3
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_CHUC_VU_EDIT frm_edit = new frm_CHUC_VU_EDIT(row_code);

            if (frm_edit.ShowDialog() == DialogResult.OK)
            {
                dg_DATA.DataSource = DAO_DIC_POSITION.Get_Data();
                int rowHandle = gv_DATA.LocateByValue(column_code, row_code);
                if (rowHandle != DevExpress.XtraGrid.GridControl.InvalidRowHandle)
                {
                    gv_DATA.FocusedRowHandle = rowHandle;
                }
            }
        }
Beispiel #4
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.!!!");
            }
        }
Beispiel #5
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);
        }
Beispiel #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_POSITION.Delete(row_code);
                dg_DATA.DataSource = DAO_DIC_POSITION.Get_Data();

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