Exemple #1
0
        private void tlbDetailAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (cmbLoaiDoiTuong.SelectedIndex == -1)
                {
                    return;
                }
                DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = null;
                AutoCompleteEntry       au          = lstSourceDoiTuongLoai.ElementAt(cmbLoaiDoiTuong.SelectedIndex);
                //Bat popup
                PopupProcess  process     = new PopupProcess();
                List <string> lstDieuKien = new List <string>();
                lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonVi);
                lstDieuKien.Add(au.KeywordStrings.FirstOrDefault());

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

                lstPopup.Clear();
                ucPopup popup = new ucPopup(false, simplePopupResponse, true);
                popup.DuLieuTraVe = new ucPopup.LayDuLieu(LayDuLieuTuPopup);
                Window win = new Window();
                win.Title = LLanguage.SearchResourceByKey("U.KeToan.DoiTuong.ucDoiTuongSoDuCT.DanhSachDoiTuong");
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    foreach (DataRow dr in lstPopup)
                    {
                        if (!lstDTuongCT.Select(f => f.MA_DTUONG).Contains(dr[2].ToString()))
                        {
                            objDTuongCT               = new DOI_TUONG_SDU_TKHOAN_CT();
                            objDTuongCT.MA_DTUONG     = dr[2].ToString();
                            objDTuongCT.TEN_TAI_KHOAN = dr[3].ToString();
                            objDTuongCT.MA_LSDU       = MA_LSDU;
                            objDTuongCT.NGAY_DL       = ClientInformation.NgayLamViecHienTai;
                            objDTuongCT.NGAY_GDICH    = ClientInformation.NgayLamViecHienTai;
                            objDTuongCT.NGAY_HLUC     = ClientInformation.NgayLamViecHienTai;
                            objDTuongCT.SODU          = 0;
                            objDTuongCT.ID_DTUONG     = Convert.ToInt32(dr[1].ToString());
                            lstDTuongCT.Add(objDTuongCT);
                        }
                    }
                    raddgrTUngCT.ItemsSource = lstDTuongCT;
                    raddgrTUngCT.Rebind();
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }
Exemple #2
0
        void TCHAT_SDU_EditCellEnd(object sender, EventArgs e)
        {
            DOI_TUONG_SDU_TKHOAN_CT objDTuong = TCHAT_SDU.cellEdit.ParentRow.Item as DOI_TUONG_SDU_TKHOAN_CT;

            lstDTuongCT[lstDTuongCT.IndexOf(objDTuong)].MA_LSDU = TCHAT_SDU.GiaTri;
        }
Exemple #3
0
        private void btnSoTaiKhoan_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //Bat popup
                if (cmbNguonVon.SelectedIndex < 0)
                {
                    return;
                }
                PopupProcess      process     = new PopupProcess();
                List <string>     lstDieuKien = new List <string>();
                AutoCompleteEntry au          = lstSourceNguonVon.ElementAt(cmbNguonVon.SelectedIndex);
                lstDieuKien.Add("%");
                lstDieuKien.Add("%");
                lstDieuKien.Add(Presentation.Process.Common.ClientInformation.MaDonViGiaoDich);
                lstDieuKien.Add(au.KeywordStrings.FirstOrDefault());
                process.getPopupInformation(DatabaseConstant.DanhSachTruyVan.POPUP_TKHOAN_CTIET.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.Title = simplePopupResponse.PopupTitle;
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                win.Content = popup;
                win.ShowDialog();
                if (lstPopup != null && lstPopup.Count > 0)
                {
                    txtSoTaiKhoan.Text     = lstPopup[0][2].ToString();
                    lblTenTaiKhoan.Content = lstPopup[0][3].ToString();
                    numSoDu.Value          = Convert.ToDouble(lstPopup[0]["SODU"]);
                    ID_TKHOAN = Convert.ToInt32(lstPopup[0][1]);
                    MA_LSDU   = lstPopup[0]["MA_LSDU"].ToString();
                    if (!lstPopup[0]["LOAI_DTUONG"].ToString().IsNullOrEmptyOrSpace())
                    {
                        cmbLoaiDoiTuong.SelectedIndex = lstSourceDoiTuongLoai.IndexOf(lstSourceDoiTuongLoai.FirstOrDefault(f => f.KeywordStrings.FirstOrDefault().Equals(lstPopup[0]["LOAI_DTUONG"].ToString())));
                        cmbLoaiDoiTuong.IsEnabled     = false;
                    }
                    else
                    {
                        cmbLoaiDoiTuong.SelectedIndex = -1;
                        cmbLoaiDoiTuong.IsEnabled     = true;
                    }
                    if (lstPopup[0]["MA_NHOM_PLOAI"].ToString().Equals("LT"))
                    {
                        raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = false;
                    }
                    else
                    {
                        raddgrTUngCT.Columns["TCHAT_SDU"].IsReadOnly = true;
                    }
                    if (lstPopup[0]["NGAY_GDICH"] != DBNull.Value)
                    {
                        telNgayChotDL.Value = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                        ngayChotDL          = LDateTime.StringToDate(lstPopup[0]["NGAY_GDICH"].ToString(), ApplicationConstant.defaultDateTimeFormat);
                    }
                    DataTable dt = null;
                    LDatatable.MakeParameterTable(ref dt);
                    LDatatable.AddParameter(ref dt, "@IdTaiKhoan", "INT", ID_TKHOAN.ToString());
                    DataSet ds = new KeToanProcess().getDanhSachTaiKhoanChiTiet(dt, "DOI_TUONG");
                    lstDTuongCT = new List <DOI_TUONG_SDU_TKHOAN_CT>();
                    if (!ds.IsNullOrEmpty() && !ds.Tables[0].IsNullOrEmpty())
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            DOI_TUONG_SDU_TKHOAN_CT objDTuongCT = new DOI_TUONG_SDU_TKHOAN_CT();
                            objDTuongCT.MA_DTUONG     = dr["MA_DTUONG"].ToString();
                            objDTuongCT.TEN_TAI_KHOAN = dr["TEN_DTUONG"].ToString();
                            objDTuongCT.MA_LSDU       = dr["MA_LSDU"].ToString();
                            objDTuongCT.NGAY_DL       = dr["NGAY_DL"].ToString();
                            objDTuongCT.NGAY_GDICH    = dr["NGAY_GDICH"].ToString();
                            objDTuongCT.NGAY_HLUC     = dr["NGAY_HLUC"].ToString();
                            objDTuongCT.SODU          = Convert.ToDecimal(dr["SO_DU"].ToString());
                            objDTuongCT.ID_DTUONG     = Convert.ToInt32(dr["ID"].ToString());
                            lstDTuongCT.Add(objDTuongCT);
                        }
                    }
                    raddgrTUngCT.ItemsSource = lstDTuongCT;
                    raddgrTUngCT.Rebind();
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
            }
        }