Example #1
0
        private void btnMaPhanLoai_Click(object sender, RoutedEventArgs e)
        {
            Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess();
            try
            {
                //Bat popup
                var process = new PopupProcess();
                process.getPopupInformation("POPUP_KT_PLOAI");

                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title   = "Danh sách mã phân loại tài khoản";
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    DataRow dr = lstPopup[0];
                    txtMaPhanLoai.Tag      = dr[0].ToString();
                    txtMaPhanLoai.Text     = dr[2].ToString();
                    lblTenPhanLoai.Content = dr[3].ToString();
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                ketoanProcess = null;
            }
        }
Example #2
0
        private void TaoTreeView()
        {
            Presentation.Process.KeToanProcess process = new Presentation.Process.KeToanProcess();
            AutoComboBox au = new AutoComboBox();

            try
            {
                AutoCompleteEntry auDonVi = au.getEntryByDisplayName(lstSourceDonVi, ref cmbDonVi);
                if (auDonVi != null)
                {
                    trvPhanLoai.Items.Clear();
                    dtMaPhanLoai = process.getDanhSachMaPhanLoai(auDonVi.KeywordStrings[0], "(''" + BusinessConstant.TrangThaiNghiepVu.DA_DUYET.layGiaTri() + "'')", BusinessConstant.TrangThaiBanGhi.SU_DUNG.layGiaTri(), "%");
                    if (dtMaPhanLoai != null && dtMaPhanLoai.Tables.Count > 0)
                    {
                        dtMaPhanLoai.Relations.Add("Master2Detail", dtMaPhanLoai.Tables[0].Columns["ID"], dtMaPhanLoai.Tables[0].Columns["ID_PLOAI_CHA"]);
                        DataView dv = dtMaPhanLoai.Tables[0].DefaultView;
                        dv.RowFilter            = "ID_PLOAI_CHA IS NULL";
                        trvPhanLoai.ItemsSource = dv;
                    }
                }
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                au      = null;
                process = null;
            }
        }
        private void HienThiPopup(DatabaseConstant.DanhSachTruyVan tenPopUp, List <string> lstDieuKien)
        {
            Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess();
            try
            {
                //Bat popup
                var process = new PopupProcess();

                process.getPopupInformation(tenPopUp.getValue(), lstDieuKien);
                SimplePopupResponse simplePopupResponse = Presentation.Process.Common.ClientInformation.SimplePopup;

                lstPopup.Clear();
                ucPopup popup = new ucPopup(false, simplePopupResponse, false);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Content = popup;
                win.Title   = simplePopupResponse.PopupTitle;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    DataRow     dr        = lstPopup[0];
                    DataRowView drCurrent = (DataRowView)raddgrHachToan.SelectedItem;
                    //if (LString.IsNullOrEmptyOrSpace(drCurrent["SO_TAI_KHOAN"].ToString()) && LString.IsNullOrEmptyOrSpace(drCurrent["MA_PLOAI"].ToString()) && LString.IsNullOrEmptyOrSpace(drCurrent["MA_DTUONG"].ToString()))
                    //{
                    //    // Them dong moi
                    //    DataRow drNew = _dtSource.NewRow();
                    //    drNew["STT"] = _dtSource.Rows.Count + 1;
                    //    if (formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_THU.layGiaTri()) || formCase.Equals(BusinessConstant.LOAI_CHUNG_TU.PHIEU_CHI.layGiaTri()))
                    //        drNew["NHOM_DKHOAN"] = "1";
                    //    _dtSource.Rows.Add(drNew);
                    //}

                    switch (tenPopUp)
                    {
                    case DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET:
                        drCurrent["ID_PLOAI"]      = dr["ID_PLOAI"];
                        drCurrent["MA_PLOAI"]      = dr["MA_PLOAI"];
                        drCurrent["SO_TAI_KHOAN"]  = dr[2];
                        drCurrent["TEN_TAI_KHOAN"] = dr[3];
                        break;

                    case DatabaseConstant.DanhSachTruyVan.POPUP_DS_DOI_TUONG:
                        drCurrent["MA_DTUONG"] = dr[2];
                        break;
                    }
                    raddgrHachToan.CommitEdit();
                    lstPopup.Clear();
                }
            }
            catch (System.Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
            finally
            {
                ketoanProcess = null;
            }
        }
        private void TaoTreeView()
        {
            Presentation.Process.KeToanProcess process = new Presentation.Process.KeToanProcess();
            AutoComboBox au = new AutoComboBox();

            try
            {
            }
            catch (System.Exception ex)
            {
                LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
            finally
            {
                au      = null;
                process = null;
            }
        }
Example #5
0
 private void txtMaPhanLoai_LostFocus(object sender, RoutedEventArgs e)
 {
     Presentation.Process.KeToanProcess ketoanProcess = new Presentation.Process.KeToanProcess();
     try
     {
         if (!LString.IsNullOrEmptyOrSpace(txtMaPhanLoai.Text))
         {
             DataTable dt = ketoanProcess.getThongTinMaPhanLoaiTheoMa(txtMaPhanLoai.Text);
             if (dt != null && dt.Rows.Count > 0)
             {
                 txtMaPhanLoai.Tag      = dt.Rows[0]["ID"].ToString();
                 txtMaPhanLoai.Text     = dt.Rows[0]["MA_PLOAI"].ToString();
                 lblTenPhanLoai.Content = dt.Rows[0]["TEN_PLOAI"].ToString();
             }
             else
             {
                 LMessage.ShowMessage("Không tồn tại mã phân loại tài khoản này", LMessage.MessageBoxType.Warning);
                 txtMaPhanLoai.Tag      = "";
                 txtMaPhanLoai.Text     = "";
                 lblTenPhanLoai.Content = "";
             }
         }
         else
         {
             txtMaPhanLoai.Tag      = "";
             txtMaPhanLoai.Text     = "";
             lblTenPhanLoai.Content = "";
         }
     }
     catch (System.Exception ex)
     {
         LMessage.ShowMessage("M.DungChung.LoiLoadDuLieu", LMessage.MessageBoxType.Error);
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
     }
     finally
     {
         ketoanProcess = null;
     }
 }
        private List <string> TuChoi(string pv_strListItem)
        {
            List <string> listResult = new List <string>();

            if (pv_strListItem != "")
            {
                List <GDICH_KSOAT> lstGdich = new List <GDICH_KSOAT>();
                List <int>         lstID    = GetListIdLock(pv_strListItem);
                string[]           str      = pv_strListItem.Split(';');
                if (str != null && str.Length > 0)
                {
                    for (int k = 0; k < str.Length; k++)
                    {
                        DataView v_dv = ListGiaoDich.DefaultView;
                        v_dv.RowFilter = "";
                        v_dv.RowFilter = "ID=" + str[k];
                        if (v_dv.Count > 0)
                        {
                            GDICH_KSOAT obj = new GDICH_KSOAT();
                            obj.DIEN_GIAI     = v_dv[0]["DIEN_GIAI"].ToString();
                            obj.ID_GDICH      = Convert.ToInt32(v_dv[0]["ID"]);
                            obj.LY_DO         = v_dv[0]["LY_DO"].ToString();
                            obj.MA_DVI        = v_dv[0]["MA_DVI"].ToString();
                            obj.MA_GDICH      = v_dv[0]["SO_GDICH"].ToString();
                            obj.MA_LOAI_GDICH = DatabaseConstant.layLoaiGiaoDich(v_dv[0]["MA_LOAI_GDICH"].ToString());
                            obj.MA_PHAN_HE    = DatabaseConstant.getModule(v_dv[0]["MA_PHAN_HE"].ToString());
                            obj.NGAY_GDICH    = v_dv[0]["NGAY_GIAO_DICH"].ToString();
                            obj.NGAY_CNHAT    = AppConfig.LoginedUser.NgayLamViecHienTai;
                            obj.NGUOI_CNHAT   = AppConfig.LoginedUser.UserName;
                            obj.NGUOI_NHAP    = v_dv[0]["NGUOI_NHAP"].ToString();
                            obj.NGAY_NHAP     = v_dv[0]["NGAY_NHAP"].ToString();
                            obj.MA_CNANG      = v_dv[0]["MA_CNANG"].ToString();
                            lstGdich.Add(obj);
                        }
                    }

                    List <ClientResponseDetail>        lstResponseDetail = new List <ClientResponseDetail>();
                    ApplicationConstant.ResponseStatus status            = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG;
                    Presentation.Process.KeToanProcess process           = new Presentation.Process.KeToanProcess();
                    // Yêu cầu lock bản ghi cần xử lý
                    UtilitiesProcess Lockprocess = new UtilitiesProcess();
                    bool             ret         = Lockprocess.LockData(DatabaseConstant.Module.GDKT,
                                                                        DatabaseConstant.Function.KT_GIAO_DICH,
                                                                        DatabaseConstant.Table.KT_GIAO_DICH,
                                                                        DatabaseConstant.Action.TU_CHOI_DUYET,
                                                                        lstID);
                    bool retUnlockData = Lockprocess.UnlockData(DatabaseConstant.Module.GDKT,
                                                                DatabaseConstant.Function.KT_GIAO_DICH,
                                                                DatabaseConstant.Table.KT_GIAO_DICH,
                                                                DatabaseConstant.Action.TU_CHOI_DUYET,
                                                                lstID);

                    if (ret)
                    {
                        status = process.KiemSoatGiaoDich(lstGdich, DatabaseConstant.Action.TU_CHOI_DUYET, ref lstResponseDetail);
                        if (status == ApplicationConstant.ResponseStatus.THANH_CONG)
                        {
                            foreach (ClientResponseDetail cl in lstResponseDetail)
                            {
                                listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0]));
                            }
                        }
                        else
                        {
                            listResult.Add("M.DungChung.DuyetKhongThanhCong#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong"));
                        }
                    }
                    else
                    {
                        listResult.Add("M.ResponseMessage.Common.LockDataInvalid#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.ResponseMessage.Common.LockDataInvalid"));
                    }
                }
            }

            return(listResult);
        }