示例#1
0
        private void SaveData()
        {
            clsChucVu_PhanCap cls = new clsChucVu_PhanCap();

            if (m_bFlag)
            {
                cls.ID_ChucVu_CapTren = Convert.ToInt32(cmbCapTren.EditValue);
                cls.ID_ChucVu_CapDuoi = Convert.ToInt32(cmbCapDuoi.EditValue);
                cls.Insert();
            }
            else
            {
                cls.ID_ChucVu_CapTren = Convert.ToInt32(fg[fg.Row, "ID_ChucVu_CapTren"]);
                cls.ID_ChucVu_CapDuoi = Convert.ToInt32(fg[fg.Row, "ID_ChucVu_CapDuoi"]);
                cls.Delete();
                cls.ID_ChucVu_CapTren = Convert.ToInt32(cmbCapTren.EditValue);
                cls.ID_ChucVu_CapDuoi = Convert.ToInt32(cmbCapDuoi.EditValue);
                cls.Insert();
            }
        }
示例#2
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (fg.Row < fg.Rows.Fixed || fg.Rows[fg.Row].IsNode)
            {
                BaseMessages.ShowInformationMessage("Chọn dòng để xóa.");
                return;
            }
            if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.No)
            {
                return;
            }

            clsChucVu_PhanCap cls = new clsChucVu_PhanCap();

            cls.ID_ChucVu_CapTren = Convert.ToInt32(cmbCapTren.EditValue);
            cls.ID_ChucVu_CapDuoi = Convert.ToInt32(cmbCapDuoi.EditValue);
            cls.Delete();
            BaseMessages.ShowInformationMessage("Xóa thành công!");
            LockEdit(true);
            Loadfg();
        }