private void RaiseSuccessEventHander(DIC_RATE item) { if (this.Success != null) { this.Success(this, item); } }
public void RaiseUpdatedEventHander(DIC_RATE Item) { if (this.Updated != null) { this.Updated(this, Item); } }
public override void Change() { if (MyRule.IsAccess("bbiDepartment")) { DIC_RATE dICRATE = new DIC_RATE(); object focusedRowCellValue = this.gbList.GetFocusedRowCellValue("RateCode"); if (focusedRowCellValue != null) { base.SetWaitDialogCaption("Đang kiểm tra dữ liệu...."); if (!(dICRATE.Get(focusedRowCellValue.ToString()) != "OK")) { this.DoHide(); xfmRateAdd _xfmRateAdd = new xfmRateAdd(Actions.Update, dICRATE); _xfmRateAdd.Updated += new xfmRateAdd.UpdatedEventHander(this.frm_Updated); _xfmRateAdd.Added += new xfmRateAdd.AddedEventHander(this.frm_Added); _xfmRateAdd.ShowDialog(); } else { this.DoHide(); XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } }
private void RaiseItemSelectedEventHander(DIC_RATE item) { if (this.ItemSelected != null) { this.ItemSelected(this, item); } }
protected override void Add() { base.Add(); DIC_RATE dICRATE = new DIC_RATE(); this.txtID.Text = dICRATE.NewID(); this.txtNAME.Focus(); }
public override void Delete() { string str; object rowCellValue; if (MyRule.IsDelete("bbiDepartment")) { bool flag = false; int[] selectedRows = this.gbList.GetSelectedRows(); if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No) { base.SetWaitDialogCaption("Đang xóa..."); DIC_RATE dICRATE = new DIC_RATE(); for (int i = (int)selectedRows.Length; i > 0; i--) { flag = true; rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "RateCode"); if (rowCellValue != null) { // SYS_LOG.Insert("Tiêu Chí Đánh Giá", "Xoá", rowCellValue.ToString()); str = dICRATE.Delete(rowCellValue.ToString()); if (str == "OK") { this.gbList.DeleteRow(selectedRows[i - 1]); } else if (str != "OK") { MessageBox.Show(string.Concat("Thông tin không được xóa\r\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } } this.DoHide(); if (!flag) { if (dICRATE.GetList().Rows.Count != 0) { rowCellValue = this.gbList.GetFocusedRowCellValue("RateCode"); if (rowCellValue != null) { // SYS_LOG.Insert("Tiêu Chí Đánh Giá", "Xoá", rowCellValue.ToString()); base.SetWaitDialogCaption("Đang xóa..."); str = dICRATE.Delete(rowCellValue.ToString()); if (str == "OK") { this.gbList.DeleteRow(this.gbList.FocusedRowHandle); } else if (str != "OK") { MessageBox.Show(string.Concat("Thông tin không được xóa\r\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand); } this.DoHide(); } } } } } }
public xfmRateAdd(Actions Action) { this.InitializeComponent(); this.Init(); this.ucAdd.Status = Action; DIC_RATE dICRATE = new DIC_RATE(); this.ucAdd.SetData(dICRATE.NewID()); this.Text = "Thêm"; }
public override void ReLoad() { base.SetWaitDialogCaption("Đang nạp dữ liệu..."); DIC_RATE dICRATE = new DIC_RATE(); this.gcList.DataSource = dICRATE.GetList(); base.SetWaitDialogCaption("Đang nạp cấu hình..."); this.gbList.ClearColumnsFilter(); base.SetWaitDialogCaption("Đã xong..."); this.DoHide(); }
protected override string uc_Delete() { DIC_RATE dICRATE = new DIC_RATE() { RateCode = this.txtID.Text }; string str = dICRATE.Delete(); if (str == "OK") { this.RaiseSuccessEventHander(dICRATE); } return(str); }
public void SetData(DIC_RATE item) { this.txtID.Text = item.RateCode; // SYS_LOG.Insert("Tiêu Chí Đánh Giá", "Xem", this.txtID.Text); if (this.m_Status == Actions.Update) { this.txtID.Properties.ReadOnly = true; } this.txtNAME.Text = item.RateName; this.calCoefficient.EditValue = item.Coefficient; this.txtDescription.Text = item.Description; this.chxUse.Checked = item.Active; (new DIC_GROUP_RATE()).AddGridLookupEdit(this.glkGroupRate); this.glkGroupRate.EditValue = item.GroupRateCode; }
public xfmRateAdd(Actions Action, DIC_RATE 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.RateCode); } }
private void ucAdd_Success(object sender, DIC_RATE 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(); }
protected override void txtID_KeyDown(object sender, KeyEventArgs e) { TextEdit textEdit = (TextEdit)sender; if (e.KeyCode == Keys.Return | e.KeyCode == Keys.Tab) { DIC_RATE dICRATE = new DIC_RATE(); if (this.m_Status == Actions.Add) { if (dICRATE.Exist(textEdit.Text)) { this.Err.SetError(textEdit, "Mã đã tồn tại."); textEdit.Focus(); } } } }
private void Init() { MyRule.Check("bbiDepartment"); this.ucToolBar.bbiPrint.Visibility = MyRule.Printed; this.ucToolBar.bbiExport.Visibility = MyRule.Exported; this.ucToolBar.bbiAdd.Visibility = MyRule.Added; this.ucToolBar.bbiDelete.Visibility = MyRule.Deleted; this.ucToolBar.bbiEdit.Visibility = MyRule.Edited; base.RibbonBar.Add.Visibility = MyRule.Added; base.RibbonBar.Change.Visibility = MyRule.Edited; base.RibbonBar.Delete.Visibility = MyRule.Deleted; base.RibbonBar.Print.Visibility = MyRule.Printed; base.RibbonBar.Export.Visibility = MyRule.Exported; base.RibbonBar.Import.Visibility = MyRule.Imported; DIC_RATE dICRATE = new DIC_RATE(); this.gcList.DataSource = dICRATE.GetList(); }
public override void SetSearch(CHBK2014_N9.Common.Class.RowClickEventArgs e) { if (this._search) { DIC_RATE dICRATE = new DIC_RATE(); object rowCellValue = this.gbList.GetRowCellValue(this.MRowClickEventArgs.RowIndex, "RateCode"); if (rowCellValue != null) { base.SetWaitDialogCaption("Đang kiểm tra dữ liệu...."); if (!(dICRATE.Get(rowCellValue.ToString()) != "OK")) { this.DoHide(); this.RaiseItemSelectedEventHander(dICRATE); } else { this.DoHide(); XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } }
protected override string uc_Save() { string str; if (MyRule.Get(MyLogin.RoleId, "bbiJob") != "OK") { str = ""; } else if (!MyRule.AllowAdd) { MyRule.Notify(); str = ""; } else if (this.glkGroupRate.EditValue != null) { // SYS_LOG.Insert("Tiêu Chí Đánh Giá", "Thêm", this.txtID.Text); base.SetWaitDialogCaption("Đang lưu dữ liệu..."); Cursor.Current = Cursors.WaitCursor; DIC_RATE dICRATE = new DIC_RATE(this.txtID.Text, this.glkGroupRate.EditValue.ToString(), this.txtNAME.Text, double.Parse(this.calCoefficient.EditValue.ToString()), this.txtDescription.Text, this.chxUse.Checked); string str1 = dICRATE.Insert(); if (str1 == "OK") { this.RaiseSuccessEventHander(dICRATE); } Cursor.Current = Cursors.Default; this.DoHide(); if (str1 != "OK") { XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } str = str1; } else { XtraMessageBox.Show("Vui lòng chọn 1 nhóm tiêu chí!", "Cảnh Báo"); str = ""; } return(str); }
private void frm_Updated(object sender, DIC_RATE Item) { this.ReLoad(); }