Exemple #1
0
        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            string str;
            object rowCellValue;

            if (MyRule.IsDelete("bbiHoliday"))
            {
                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_HOLIDAY dICHOLIDAY = new DIC_HOLIDAY();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag         = true;
                        rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "HolidayID");
                        if (rowCellValue != null)
                        {
                            //  SYS_LOG.Insert("Danh Sách Ngày Nghỉ, Ngày Lể", "Xoá", rowCellValue.ToString());
                            str = dICHOLIDAY.Delete(new Guid(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", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        rowCellValue = this.gbList.GetFocusedRowCellValue("HolidayID");
                        if (rowCellValue != null)
                        {
                            //   SYS_LOG.Insert("Danh Sách Ngày Nghỉ, Ngày Lể", "Xoá", rowCellValue.ToString());
                            base.SetWaitDialogCaption("Đang xóa...");
                            str = dICHOLIDAY.Delete(new Guid(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", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                            this.DoHide();
                        }
                    }
                }
            }
        }
Exemple #2
0
        protected override string uc_Delete()
        {
            DIC_HOLIDAY dICHOLIDAY = new DIC_HOLIDAY()
            {
                HolidayID = this.m_HolidayID
            };
            string str = dICHOLIDAY.Delete();

            if (str == "OK")
            {
                this.RaiseSuccessEventHander(dICHOLIDAY);
            }
            return(str);
        }