Esempio n. 1
0
        /// <summary>
        /// Xử lý duyệt
        /// </summary>
        private void Duyet()
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                List <int> lstID = new List <int>();
                List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                foreach (DataRow row in grDanhSach.SelectedItems)
                {
                    if ((int)row[2] > 0)
                    {
                        lstID.Add((int)row[2]);
                    }
                }

                if (danhmucProcess.DuyetDungChung(lstID.ToArray(), ref listResponseDetail))
                {
                    LMessage.ShowMessage("M.DanhMuc.ucDonViDS.XoaThanhCong", LMessage.MessageBoxType.Information);
                }
                else
                {
                    LMessage.ShowMessage("M.DanhMuc.ucDonViDS.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
                LoadDuLieu();
            }
            catch (System.Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                if (ex.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.Message, ex.InnerException).ShowDialog();
                }
                else if (ex.InnerException.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.InnerException.Message, ex.InnerException).ShowDialog();
                }
                else
                {
                    new frmThongBaoLoi("M.DanhMuc.ucDonViDS.LoiXoaDuLieu", ex).ShowDialog();
                }
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
Esempio n. 2
0
        /// <summary>
        /// Xử lý duyệt
        /// </summary>
        private void Duyet()
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                List <int> lstID = new List <int>();
                List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                lstID.Add((int)LstChiTiet[0][1]);

                if (danhmucProcess.DuyetDungChung(lstID.ToArray(), ref listResponseDetail))
                {
                    CustomControl.CommonFunction.RefreshButton(Toolbar, DatabaseConstant.Action.DUYET, LstChiTiet[0][1].ToString());
                    LMessage.ShowMessage("M.DungChung.DuyetThanhCong", LMessage.MessageBoxType.Information);
                    HoanThanh();
                }
                else
                {
                    LMessage.ShowMessage("M.DungChung.DuyetKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
            }
            catch (System.Exception ex)
            {
                this.Cursor = Cursors.Arrow;
                if (ex.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.Message, ex.InnerException).ShowDialog();
                }
                else if (ex.InnerException.GetType() == typeof(CustomException))
                {
                    new frmThongBaoLoi(ex.InnerException.Message, ex.InnerException).ShowDialog();
                }
                else
                {
                    new frmThongBaoLoi("M.DungChung.LoiDuyet", ex).ShowDialog();
                }
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }