Beispiel #1
0
        public override void Delete()
        {
            string str;
            object rowCellValue;

            if (MyRule.IsDelete("bbiGroup"))
            {
                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...");
                    HRM_GROUP hRMGROUP = new HRM_GROUP();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag         = true;
                        rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "GroupCode");
                        if (rowCellValue != null)
                        {
                            //   SYS_LOG.Insert("Danh Sách Tổ Nhóm", "Xoá", rowCellValue.ToString());
                            str = hRMGROUP.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 (hRMGROUP.GetList().Rows.Count != 0)
                        {
                            rowCellValue = this.gbList.GetFocusedRowCellValue("GroupCode");
                            if (rowCellValue != null)
                            {
                                //   SYS_LOG.Insert("Danh Sách Tổ Nhóm", "Xoá", rowCellValue.ToString());
                                base.SetWaitDialogCaption("Đang xóa...");
                                str = hRMGROUP.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();
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public override void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            HRM_GROUP hRMGROUP = new HRM_GROUP();

            this.gcList.DataSource = hRMGROUP.GetList();
            base.SetWaitDialogCaption("Đang nạp cấu hình...");
            this.gbList.ClearColumnsFilter();
            base.SetWaitDialogCaption("Đã xong...");
            this.DoHide();
        }
Beispiel #3
0
        private void Init()
        {
            MyRule.Check("bbiGroup");
            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;
            HRM_GROUP hRMGROUP = new HRM_GROUP();

            this.gcList.DataSource = hRMGROUP.GetList();
        }