Exemple #1
0
        public override void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            DIC_STATE dICSTATE = new DIC_STATE();

            this.gcList.DataSource = dICSTATE.GetList();
            base.SetWaitDialogCaption("Đang nạp cấu hình...");
            this.gbList.ClearColumnsFilter();
            base.SetWaitDialogCaption("Đã xong...");
            this.DoHide();
        }
Exemple #2
0
        public override void Delete()
        {
            string str;
            object rowCellValue;
            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_STATE dICSTATE = new DIC_STATE();
                for (int i = (int)selectedRows.Length; i > 0; i--)
                {
                    flag         = true;
                    rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "StateCode");
                    if (rowCellValue != null)
                    {
                        //  SYS_LOG.Insert("Danh Mục Công Đoạn", "Xoá", rowCellValue.ToString());
                        str = dICSTATE.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 (dICSTATE.GetList().Rows.Count != 0)
                    {
                        rowCellValue = this.gbList.GetFocusedRowCellValue("StateCode");
                        if (rowCellValue != null)
                        {
                            // SYS_LOG.Insert("Danh Mục Công Đoạn", "Xoá", rowCellValue.ToString());
                            base.SetWaitDialogCaption("Đang xóa...");
                            str = dICSTATE.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();
                        }
                    }
                }
            }
        }
Exemple #3
0
        private void Init()
        {
            MyRule.Check("bbiProduct");
            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_STATE dICSTATE = new DIC_STATE();

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