Example #1
0
        public bool ThongTinTaiSan(DatabaseConstant.Function function, DatabaseConstant.Action action, List <int> lstID, ref TS_TAI_SAN_DTO obj, ref List <ClientResponseDetail> listClientResponseDetail)
        {
            //Kiểm tra kết nối, server, service trước khi request
            Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.TaiSanService.layGiaTri());
            TaiSanRequest  request  = Common.Utilities.PrepareRequest(new TaiSanServiceRef.TaiSanRequest());
            TaiSanResponse response = new TaiSanServiceRef.TaiSanResponse();

            try
            {
                //Khoi tao request
                request.Function  = function;
                request.Action    = action;
                request.objTS_Dto = obj;
                request.lstID     = lstID.ToArray();

                // make a call to service client
                response = Client.QuanLyTaiSan(request);

                //Kiem tra ket qua tra ve
                Common.Utilities.ValidResponse(request, response);

                if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG)
                {
                    obj = response.objTS_Dto;
                    return(true);
                }
                else
                {
                    listClientResponseDetail = Common.Utilities.convertToClientResponseDetail(response);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                return(false);
            }
        }
        private void Luu()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            List <DC_HAN_MUC> lstHanMuc = null;

            try
            {
                if (!Validation())
                {
                    return;
                }

                GetFormData(ref lstHanMuc);

                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;
                ret = new HanMucProcess().HanMucChung(DatabaseConstant.Action.SUA, ref lstHanMuc, ref listClientResponseDetail);

                if (ret == true)
                {
                    LMessage.ShowMessage("M.DungChung.CapNhatThanhCong", LMessage.MessageBoxType.Information);
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                lstHanMuc            = null;
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #3
0
        /// <summary>
        /// Sự kiện load dữ liệu lên form
        /// </summary>
        private void LoadForm()
        {
            DanhMucProcess danhmucProcess = new DanhMucProcess();

            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                if (idPhanHeGD != 0)
                {
                    //Sự kiện load dữ liệu
                    DataSet dsPhanHeGD = danhmucProcess.getDanhSachPhanHeGDTheoID(idPhanHeGD);
                    if (dsPhanHeGD != null && dsPhanHeGD.Tables.Count > 0)
                    {
                        DataTable dtPhanHeGD = danhmucProcess.getDanhSachPhanHeGDTheoID(idPhanHeGD).Tables[0];
                        if (dtPhanHeGD.Rows.Count > 0)
                        {
                            lblTrangThai.Content            = BusinessConstant.layTrangThaiNghiepVu(dtPhanHeGD.Rows[0]["TTHAI_NVU"].ToString());
                            txtMaLoaiGD.Text                = dtPhanHeGD.Rows[0]["MA_LOAI_GDICH"].ToString();
                            txtNgayDuyet.Text               = dtPhanHeGD.Rows[0]["NGAY_CNHAT"].ToString();
                            txtNgayLap.Text                 = dtPhanHeGD.Rows[0]["NGAY_NHAP"].ToString();
                            txtTenLoaiGD.Text               = dtPhanHeGD.Rows[0]["TEN_LOAI_GDICH"].ToString();
                            txtTentat.Text                  = dtPhanHeGD.Rows[0]["TEN_TAT"].ToString();
                            txtTrangThaiBanGhi.Text         = dtPhanHeGD.Rows[0]["TTHAI_BGHI"].ToString();
                            txtNguoiDuyet.Text              = dtPhanHeGD.Rows[0]["NGUOI_CNHAT"].ToString();
                            txtNguoiLap.Text                = dtPhanHeGD.Rows[0]["NGUOI_NHAP"].ToString();
                            cmbPhanHe.SelectedIndex         = lstSourcePhanHe.IndexOf(lstSourcePhanHe.FirstOrDefault(i => i.KeywordStrings.First().Equals(dtPhanHeGD.Rows[0]["MA_PHAN_HE"].ToString())));
                            cmbTrangThaiSDung.SelectedIndex = lstSourceTrangThai.IndexOf(lstSourceTrangThai.FirstOrDefault(i => i.KeywordStrings.First().Equals(dtPhanHeGD.Rows[0]["TTHAI_BGHI"].ToString())));
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DanhMuc.ucPhanHeGDCT.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
Example #4
0
        private void BuildFormDieuKien()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                if (grid.SelectedItems.Count > 0)
                {
                    // Lấy báo cáo được chọn từ grid
                    DataRowView dr      = (DataRowView)grid.SelectedItem;
                    string      maHoTro = dr["MA_HOTRO"].ToString();

                    // Lấy thông tin
                    DataSet ds = process.GetChiTietHoTro(maHoTro);

                    if (ds != null && ds.Tables.Count > 0)
                    {
                        string uriDieuKien = "/" + ds.Tables[0].Rows[0]["NHOM_DIEUKIEN"].ToString() + ";component/" + ds.Tables[0].Rows[0]["FILE_DIEUKIEN"].ToString();
                        dataQueryGet = ds.Tables[0].Rows[0]["DATA_QUERY_GET"].ToString();
                        dataQuerySet = ds.Tables[0].Rows[0]["DATA_QUERY_SET"].ToString();

                        uc = (UserControl)System.Windows.Application.LoadComponent(new Uri(uriDieuKien, System.UriKind.RelativeOrAbsolute));
                    }

                    if (!LObject.IsNullOrEmpty(uc.GetType().GetProperty("dataQueryGet")))
                    {
                        uc.GetType().GetProperty("dataQueryGet").SetValue(uc, dataQueryGet, null);
                    }

                    frFormInput.Content = uc;
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            Mouse.OverrideCursor = Cursors.Arrow;
        }
        public void AfterModify(bool ret, NS_DM_HOC_HAM obj, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret)
                {
                    LMessage.ShowMessage("M.DungChung.CapNhatThanhCong", LMessage.MessageBoxType.Information);

                    trangThaiNVu            = obj.TTHAI_NVU;
                    lblTrangThai.Content    = BusinessConstant.layNgonNguNghiepVu(trangThaiNVu);
                    txtTrangThaiBanGhi.Text = BusinessConstant.layNgonNguSuDung(obj.TTHAI_BGHI);
                    raddtNgayCapNhat.Value  = LDateTime.StringToDate(ClientInformation.NgayLamViecHienTai, "yyyyMMdd");
                    txtNguoiCapNhat.Text    = ClientInformation.TenDangNhap;

                    BeforeViewFromDetail();
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }

                // Yêu cầu Unlock bản ghi cần sửa
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(id);

                bool retUnlockData = process.UnlockData(DatabaseConstant.Module.NSTL,
                                                        DatabaseConstant.Function.NS_DM_HOC_HAM_CT,
                                                        DatabaseConstant.Table.NS_DM_HOC_HAM,
                                                        DatabaseConstant.Action.SUA,
                                                        listLockId);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
 private void loadWidthColumnBaoCao()
 {
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         for (int i = 0; i < grDSBaoCao.Columns.Count; i++)
         {
             if (i == 0)
             {
                 grDSBaoCao.Columns[i].IsVisible = false;
             }
             else if (i == 1)
             {
                 grDSBaoCao.Columns[i].Width      = new Telerik.Windows.Controls.GridViewLength(40, Telerik.Windows.Controls.GridViewLengthUnitType.Pixel);
                 grDSBaoCao.Columns[i].IsReadOnly = true;
             }
             else if (i == 2)
             {
                 grDSBaoCao.Columns[i].IsVisible = false;
             }
             else if (i == 3)
             {
                 grDSBaoCao.Columns[i].Width      = new Telerik.Windows.Controls.GridViewLength(1, Telerik.Windows.Controls.GridViewLengthUnitType.Star);
                 grDSBaoCao.Columns[i].IsReadOnly = true;
             }
             else
             {
                 grDSBaoCao.Columns[i].Width = new Telerik.Windows.Controls.GridViewLength(1, Telerik.Windows.Controls.GridViewLengthUnitType.Auto);
             }
         }
     }
     catch (System.Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
     Mouse.OverrideCursor = Cursors.Arrow;
 }
Example #7
0
        /// <summary>
        /// Trước khi sửa
        /// </summary>
        private void BeforeModify()
        {
            try
            {
                List <DataRowView> listDataRow = getListSeletedDataRow();

                if (listDataRow != null)
                {
                    if (listDataRow.Count == 0)
                    {
                        LMessage.ShowMessage("M.DungChung.ChuaChonBanGhi", LMessage.MessageBoxType.Warning);
                        return;
                    }
                    else if (listDataRow.Count > 1)
                    {
                        LMessage.ShowMessage("M.DungChung.KhongDuocChonNhieu", LMessage.MessageBoxType.Warning);
                        return;
                    }
                    else
                    {
                        currentPage     = grid.Items.PageIndex;
                        currentPosition = grid.Items.CurrentPosition;
                        currentID       = int.Parse(listDataRow.First()["ID"].ToString());

                        OnModify(currentID);
                    }
                }
                else
                {
                    LMessage.ShowMessage("Lỗi chọn dữ liệu để xử lý", LMessage.MessageBoxType.Warning);
                    return;
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
        private void btnKhachHang_Click(object sender, RoutedEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                var           process     = new PopupProcess();
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings.First());
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_DS_KHACHHANG_PGD.getValue(), lstDieuKien);

                SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;

                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Content               = popup;
                Mouse.OverrideCursor      = Cursors.Arrow;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Title = "Danh sách khách hàng";
                win.ShowDialog();
                if (lstPopup != null)
                {
                    DataRow          row       = lstPopup[0];
                    KhachHangProcess processKH = new KhachHangProcess();
                    DataRow          dr        = processKH.getThongTinCoBanKHTheoID(Convert.ToInt32(row[1])).Tables[0].Rows[0];

                    AfterGetKhachHang(dr);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #9
0
        private void LayDuLieu()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                if (txtMaGiaoDich.Text.IsNullOrEmptyOrSpace())
                {
                    return;
                }

                DataTable dt = null;
                LDatatable.MakeParameterListTable(ref dt);
                LDatatable.AddParameterList(ref dt, "MA_NSD", ClientInformation.TenDangNhap);
                LDatatable.AddParameterList(ref dt, "MA_GDICH", txtMaGiaoDich.Text);

                DataSet ds = new HoTroProcess().LayDuLieu(dataQueryGet, dt);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    raddtNgayGiaoDich.Value = LDateTime.StringToDate(ds.Tables[0].Rows[0]["NGAY_GDICH"].ToString(), "yyyyMMdd");
                    txtDienGiai.Text        = ds.Tables[0].Rows[0]["DIEN_GIAI"].ToString();

                    grid.ItemsSource = ds.Tables[0].DefaultView;
                }
                else
                {
                    grid.ItemsSource = null;
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                CommonFunction.ThongBaoLoi(ex);
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #10
0
        /// <summary>
        /// Sửa
        /// </summary>
        /// <param name="id"></param>
        private void OnModify(int id)
        {
            try
            {
                ucDmLyDoNghiPhepCT userControl = new ucDmLyDoNghiPhepCT();

                // Yêu cầu lock bản ghi cần sửa
                UtilitiesProcess process    = new UtilitiesProcess();
                List <int>       listLockId = new List <int>();
                listLockId.Add(id);

                bool ret = process.LockData(DatabaseConstant.Module.NSTL,
                                            DatabaseConstant.Function.NS_DM_LDO_NPHEP_CT,
                                            DatabaseConstant.Table.NS_DM_LDO_NPHEP,
                                            DatabaseConstant.Action.SUA,
                                            listLockId);
                if (ret)
                {
                    userControl.OnSavingCompleted += new EventHandler(userControl_OnSavingCompleted);
                    userControl.Action             = DatabaseConstant.Action.SUA;
                    userControl.ID = id;

                    Window window = new Window();
                    window.Title = DatabaseConstant.layNgonNguTieuDeForm(DatabaseConstant.Function.NS_DM_LDO_NPHEP_CT);
                    window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    window.Content = userControl;
                    window.ShowDialog();
                }
                else
                {
                    LMessage.ShowMessage("M.ResponseMessage.Common.LockDataInvalid", LMessage.MessageBoxType.Information);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
Example #11
0
 /// <summary>
 /// Sự kiện chọn ngày của DatetimePicker
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         DatePicker    dtpControl = (DatePicker)sender;
         StringBuilder sbControl  = new StringBuilder();
         sbControl.Append("teldt");
         sbControl.Append(dtpControl.Name.Substring(3));
         RadMaskedDateTimeInput telControl = (RadMaskedDateTimeInput)grMain.FindName(sbControl.ToString());
         if (telControl != null)
         {
             telControl.Value = dtpControl.SelectedDate;
         }
         else
         {
             throw new System.NullReferenceException(LLanguage.SearchResourceByKey("M.TinDung.HanMuc.ucHanMucCT.KhongTimThayControl") + sbControl.ToString());
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
 private void grvDanhSachHDTD_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         Mouse.OverrideCursor = Cursors.Wait;
         DataRowView drv = (DataRowView)grvDanhSachHDTD.SelectedItem;
         DataSet     ds  = new KhaiThacDuLieuProcess().GetThongTinDanhSachKUOC(Convert.ToInt32(drv["ID"]), drv["MA_HDTDVM"].ToString());
         if (!LObject.IsNullOrEmpty(ds.Tables) && ds.Tables.Count > 0)
         {
             grvDanhSachKUVM.ItemsSource = ds.Tables["DANHSACH.KUOCVM"].DefaultView;
         }
     }
     catch (System.Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
     }
     finally
     {
         grvKheUocGD.ItemsSource = null;
         Mouse.OverrideCursor    = Cursors.Arrow;
     }
 }
Example #13
0
 public void OnDelete()
 {
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         bool ret = false;
         List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
         KhaiThacDuLieuProcess       processKTDL = new KhaiThacDuLieuProcess();
         obj.ID   = ID;
         obj.MATK = MA_TK;
         ret      = processKTDL.MaTK(DatabaseConstant.Action.XOA, ref obj, ref listClientResponseDetail);
         AfterDelete(ret, listClientResponseDetail);
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
         throw ex;
     }
     finally
     {
         Mouse.OverrideCursor = Cursors.Arrow;
     }
 }
Example #14
0
        private void TaocomboboxCBTD()
        {
            try
            {
                // khởi tạo combobox
                AutoComboBox auto = new AutoComboBox();
                lstSourceCBTD = new ListCheckBoxCombo();
                string maChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First();
                string idChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings[1];

                List <string> lstDieuKien = new List <string>();

                // khởi tạo combobox
                auto = new AutoComboBox();
                lstDieuKien.Add(maChiNhanh);
                lstDieuKien.Add(BusinessConstant.LOAI_HO_SO.CHINH_THUC.layGiaTri());
                new AutoComboBoxListCheckes().GenAutoComboBox(ref lstSourceCBTD, ref cmbCBTD, DatabaseConstant.DanhSachTruyVan.COMBOBOX_NHAN_SU_LIST.getValue(), lstDieuKien);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
Example #15
0
 public void GenComboBox_Thang(ref RadComboBox comboBox, string maChon = null)
 {
     try
     {
         for (int month = 1; month <= 12; month++)
         {
             AutoCompleteEntry auto = new AutoCompleteEntry(month.ToString(), month.ToString(), month.ToString());
             comboBox.Items.Add(auto);
         }
         if (maChon.IsNullOrEmptyOrSpace())
             maChon = Convert.ToInt32(ClientInformation.NgayLamViecHienTai.Substring(4, 2)).ToString();
         foreach (var item in comboBox.Items)
         {
             AutoCompleteEntry entry = (AutoCompleteEntry)item;
             if (entry.DisplayName.Equals(maChon))
                 comboBox.SelectedItem = item;
         }
     }
     catch (Exception e)
     {
         LLogging.WriteLog("", LLogging.LogType.ERR, e);
     }
 }
Example #16
0
 private void BuildGrid()
 {
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         string  maPhanHeBaoCao = ClientInformation.FormCase;
         DataSet ds             = process.GetDanhSachHoTro(ClientInformation.TenDangNhap, maPhanHeBaoCao);
         if (ds != null && ds.Tables.Count > 0)
         {
             grid.ItemsSource = ds.Tables[0].DefaultView;
         }
         else
         {
             grid.ItemsSource = null;
         }
     }
     catch (System.Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
     Mouse.OverrideCursor = Cursors.Arrow;
 }
Example #17
0
        private void Save()
        {
            try
            {
                List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>();
                objTinNhanDen = new TIN_NHAN_DEN();
                List <RECEIVER> lstReceivers = new List <RECEIVER>();
                foreach (RECEIVER objTinNhan in grdTinNhanDenDS.SelectedItems)
                {
                    lstReceivers.Add(objTinNhan);
                }
                objTinNhanDen.DSaReceivers = lstReceivers.ToArray();

                int iret = new SMSProcess().TinNhanDen(DatabaseConstant.Action.THEM, ref objTinNhanDen,
                                                       ref lstClientResponseDetails);
                CommonFunction.ThongBaoKetQua(lstClientResponseDetails);
            }
            catch (Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
Example #18
0
 private void Save()
 {
     try
     {
         List <ClientResponseDetail> lstClientResponseDetails = new List <ClientResponseDetail>();
         int iret = GetDataForm();
         if (iret > 0)
         {
             iret = new SMSProcess().TinNhanDi(DatabaseConstant.Action.THEM, ref objTinNhanDi,
                                               ref lstClientResponseDetails);
             CommonFunction.ThongBaoKetQua(lstClientResponseDetails);
         }
         else
         {
             LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error);
         }
     }
     catch (Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiKhongXacDinh", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
Example #19
0
        public void AfterDelete(bool ret, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret == true)
                {
                    LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                    //LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                }

                // Đóng cửa sổ chi tiết sau khi xóa
                OnClose();
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
 private void LoadComboboxNhom()
 {
     try
     {
         lstSourceNhom = new List <AutoCompleteEntry>();
         AutoComboBox  auto        = new AutoComboBox();
         List <string> lstDieuKien = new List <string>();
         machinhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings[1];
         maphonggd  = lstSourcePhongGD_Select.ElementAt(cmbPhongGD.SelectedIndex).KeywordStrings[3];
         makhuvuc   = lstSourceKhuVuc.ElementAt(cmbKhuVuc.SelectedIndex).KeywordStrings[1];
         macum      = lstSourceCum.ElementAt(cmbCum.SelectedIndex).KeywordStrings[1];
         lstDieuKien.Add(maphonggd);
         lstDieuKien.Add(makhuvuc);
         lstDieuKien.Add(macum);
         cmbNhom.Items.Clear();
         auto.GenAutoComboBox(ref lstSourceNhom, ref cmbNhom, "COMBOBOX_NHOM_NQL", lstDieuKien);
         isLoad = true;
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
Example #21
0
 public void GenComboBox_Quy(ref RadComboBox comboBox, string maChon = null)
 {
     try
     {
         for (int quy = 1; quy <= 4; quy++)
         {
             AutoCompleteEntry auto = new AutoCompleteEntry(quy.ToString(), quy.ToString(), quy.ToString());
             comboBox.Items.Add(auto);
         }
         if (maChon.IsNullOrEmptyOrSpace())
             maChon = ClientInformation.NgayLamViecHienTai.StringToDate("yyyyMMdd").GetQuarter().ToString();
         foreach (var item in comboBox.Items)
         {
             AutoCompleteEntry entry = (AutoCompleteEntry)item;
             if (entry.DisplayName.Equals(maChon))
                 comboBox.SelectedItem = item;
         }
     }
     catch (Exception e)
     {
         LLogging.WriteLog("", LLogging.LogType.ERR, e);
     }
 }
Example #22
0
        public HT_NSD_PVI Them(HT_NSD_PVI obj)
        {
            HT_NSD_PVI kq       = null;
            Entities   entities = ContextFactory.GetInstance();

            try
            {
                entities.HT_NSD_PVI.AddObject(obj);
                entities.SaveChanges();
                kq = obj;
            }
            catch (System.Exception ex)
            {
                kq = null;
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                entities = null;
            }
            return(kq);
        }
Example #23
0
        public bool Xoa(HT_TSO obj)
        {
            bool     kq       = true;
            Entities entities = ContextFactory.GetInstance();

            try
            {
                entities.HT_TSO.Attach(obj);
                entities.HT_TSO.DeleteObject(obj);
                entities.SaveChanges();
            }
            catch (System.Exception ex)
            {
                kq = false;
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                entities = null;
            }
            return(kq);
        }
 private bool Validation()
 {
     try
     {
         if (cmbDoiTuong.SelectedIndex < 0)
         {
             CommonFunction.ThongBaoChuaChon(lblLoaiDTuong.Content.ToString());
             cmbDoiTuong.Focus();
             return(false);
         }
         if (grDSDoiTuong.SelectedItems.Count < 1)
         {
             LMessage.ShowMessage("Chưa chọn đối tượng", LMessage.MessageBoxType.Warning);
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
         return(false);
     }
 }
 private void BeforDelete(bool bKetQua, List <ClientResponseDetail> listClientResponseDetail)
 {
     try
     {
         if (bKetQua)
         {
             CommonFunction.ThongBaoKetQua(listClientResponseDetail);
             CommonFunction.CloseUserControl(this);
         }
         else
         {
             LMessage.ShowMessage("M.DungChung.LoiXoaDuLieu", LMessage.MessageBoxType.Error);
         }
     }
     catch (System.Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiChung", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
     finally
     {
     }
 }
Example #26
0
        public void OnAddNew(DM_CUM obj)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                DanhMucProcess processDanhMuc = new DanhMucProcess();
                List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>();
                bool ret = false;

                DM_TEMP_CUM objTempCum = new DM_TEMP_CUM();
                ret = processDanhMuc.Cum02(DatabaseConstant.Action.THEM, ref obj, ref objTempCum, ref listClientResponseDetail);
                AfterAddNew(ret, obj, listClientResponseDetail);
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
Example #27
0
 /// <summary>
 /// Sự kiện chọn ngày của DatetimePicker
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         DatePicker    dtpControl = (DatePicker)sender;
         StringBuilder sbControl  = new StringBuilder();
         sbControl.Append("teldt");
         sbControl.Append(dtpControl.Name.Substring(3));
         RadMaskedDateTimeInput telControl = (RadMaskedDateTimeInput)grMain.FindName(sbControl.ToString());
         if (telControl != null)
         {
             telControl.Value = dtpControl.SelectedDate;
         }
         else
         {
             throw new System.NullReferenceException("Không tìm thấy control " + sbControl.ToString());
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
 }
        private void LoadComboboxPhongGD()
        {
            try
            {
                // khởi tạo combobox
                AutoComboBox auto = new AutoComboBox();

                lstSourcePhongGD_Select = new List <AutoCompleteEntry>();
                string maChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex).KeywordStrings.First();
                lstSourcePhongGD_Select = lstSourcePhongGD.Where(e => e.KeywordStrings.ElementAt(1).Equals(maChiNhanh)).ToList();

                // khởi tạo combobox
                auto = new AutoComboBox();
                cmbPhongGD.Items.Clear();
                auto.GenAutoComboBox(ref lstSourcePhongGD_Select, ref cmbPhongGD, null);
                cmbPhongGD.SelectedIndex = 0;
                //cmbPhongGD.IsEnabled = !maChiNhanh.Equals("%");
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }
        public void AfterAddNew(bool ret, List <ClientResponseDetail> listClientResponseDetail)
        {
            try
            {
                if (ret)
                {
                    LMessage.ShowMessage("M.DungChung.ThemThanhCong", LMessage.MessageBoxType.Information);


                    sTrangThaiNVu = BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri();
                    BeforeViewFromDetail();
                }
                else
                {
                    CommonFunction.ThongBaoKetQua(listClientResponseDetail);
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
                throw ex;
            }
        }
Example #30
0
        public List <ThamSoBaoCao> GetParameters()
        {
            List <ThamSoBaoCao> listThamSoBaoCao = new List <ThamSoBaoCao>();

            try
            {
                if (!Validation())
                {
                    return(null);
                }
                AutoCompleteEntry auChiNhanh = lstSourceChiNhanh.ElementAt(cmbChiNhanh.SelectedIndex);
                string            maDonViBC  = "";
                if (auChiNhanh.KeywordStrings[0].Equals("%"))
                {
                    maDonViBC = ClientInformation.MaToChuc;
                }
                else
                {
                    maDonViBC = auChiNhanh.KeywordStrings[0];
                }
                DataTable table = ((DataView)raddgrDuLieuBCao.ItemsSource).Table;
                listThamSoBaoCao.Add(new ThamSoBaoCao("P_NgayBaoCao", LDateTime.DateToString(raddtNgayBaoCao.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet));
                listThamSoBaoCao.Add(new ThamSoBaoCao("P_DonViTinh", numDonViTinh.Value.GetValueOrDefault().ToString(), ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet));
                listThamSoBaoCao.Add(new ThamSoBaoCao("P_NguoiLap", ClientInformation.HoTen, ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet));
                listThamSoBaoCao.Add(new ThamSoBaoCao("P_NgayDuLieu", LDateTime.DateToString(raddtNgayChotSoLieu.Value.GetValueOrDefault(), ApplicationConstant.defaultDateTimeFormat), ApplicationConstant.LoaiThamSoBaoCao.GUI.layGiaTri(), new List <string>(), table.DataSet));

                listThamSoBaoCao.Add(new ThamSoBaoCao("@P_MaDonVi", maDonViBC, ApplicationConstant.LoaiThamSoBaoCao.GUIPARAM.layGiaTri(), new List <string>(), table.DataSet));
                return(listThamSoBaoCao);
            }
            catch (System.Exception ex)
            {
                Mouse.OverrideCursor = Cursors.Arrow;
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            return(listThamSoBaoCao);
        }