private void btnSoKheUoc_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add("0");
            lstDieuKien.Add(ClientInformation.MaDonVi);
            lstDieuKien.Add("KUOCTRANO");
            lstDieuKien.Add(ClientInformation.NgayLamViecHienTai);
            lstDieuKien.Add("%");
            lstPopupKU = new List <int>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_KHEUOC", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopupKheUocViMo   popup = new ucPopupKheUocViMo(true, simplePopupResponse, true);

            popup.LayGiaTriListID = new ucPopupKheUocViMo.LayListID(LayDuLieuTuPopup);
            Window win = new Window();

            win.Content = popup;
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopupKU.Count > 0)
            {
                foreach (int drv in lstPopupKU)
                {
                }
            }
            Cursor = Cursors.Arrow;
        }
Example #2
0
 private void HienThiDSKheUoc()
 {
     Cursor = Cursors.Wait;
     try
     {
         string        sHinhThucXuLy = lstHinhThucXuLy.ElementAt(cmbHinhThucXuLyNo.SelectedIndex).KeywordStrings[0];
         List <string> lstDieuKien   = new List <string>();
         string        sidKheUoc     = "0";
         int           idKUoc        = 0;
         lstDieuKien.Add(sidKheUoc);
         lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
         lstDieuKien.Add(sHinhThucXuLy);
         lstDieuKien.Add(ClientInformation.NgayLamViecHienTai);
         lstDieuKien.Add("%");
         PopupProcess process = new PopupProcess();
         process.getPopupInformation("POPUP_DS_KHEUOC", lstDieuKien);
         SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
         ucPopupKheUocViMo   popup = new ucPopupKheUocViMo(true, simplePopupResponse, false);
         popup.LayGiaTriListID = new ucPopupKheUocViMo.LayListID(LayDuLieuTuPopup);
         Window win = new Window();
         win.Title = LLanguage.SearchResourceByKey(simplePopupResponse.PopupTitle);
         win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         win.Content = popup;
         win.ShowDialog();
         if (lstPopupKU.Count > 0)
         {
             idKUoc = lstPopupKU[0];
             LayThongTinKheUoc(idKUoc, txtSoKheUoc.Text.Trim(), "GetByID");
         }
     }
     catch (Exception ex)
     {
         LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
         CommonFunction.ThongBaoLoi(ex);
     }
     finally
     {
         Cursor = Cursors.Arrow;
     }
 }
Example #3
0
        private void tlbTinhLai_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;
            string sidKheUoc = "";

            foreach (DANH_SACH_KHE_UOC_DU_THU objDSKUOC in lstDuThu)
            {
                sidKheUoc += "," + objDSKUOC.ID_KHE_UOC.ToString();
            }
            if (sidKheUoc.Length > 0)
            {
                sidKheUoc = sidKheUoc.Substring(1);
            }
            else
            {
                sidKheUoc = "0";
            }
            List <string> lstDieuKien = new List <string>();

            lstDieuKien.Add(sidKheUoc);
            lstDieuKien.Add(ClientInformation.MaDonViGiaoDich);
            lstDieuKien.Add("KUOCDUTHU");
            lstDieuKien.Add(LDateTime.DateToString(teldtDuThuDenNgay.Value.Value, ApplicationConstant.defaultDateTimeFormat));
            lstDieuKien.Add("%");
            lstPopupKU = new List <DataRow>();
            PopupProcess popupProcess = new PopupProcess();

            popupProcess.getPopupInformation("POPUP_DS_KHEUOC", lstDieuKien);
            SimplePopupResponse simplePopupResponse = ClientInformation.SimplePopup;
            ucPopupKheUocViMo   popup = new ucPopupKheUocViMo(true, simplePopupResponse, true);

            popup.LayGiaTriListDataRow = new ucPopupKheUocViMo.LayListDataRow(LayDuLieuTuPopup);
            Window win = new Window();

            win.Content = popup;
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowDialog();
            if (lstPopupKU.Count > 0)
            {
                foreach (DataRow drv in lstPopupKU)
                {
                    DANH_SACH_KHE_UOC_DU_THU objKUOC = new DANH_SACH_KHE_UOC_DU_THU();
                    foreach (DataColumn dtl in drv.Table.Columns)
                    {
                        PropertyInfo proper = objKUOC.GetType().GetProperty(dtl.ColumnName);
                        if (proper != null)
                        {
                            if (proper.PropertyType == typeof(int))
                            {
                                proper.SetValue(objKUOC, Convert.ToInt32(drv[dtl.ColumnName]), null);
                            }
                            else if (proper.PropertyType == typeof(decimal))
                            {
                                proper.SetValue(objKUOC, Convert.ToDecimal(drv[dtl.ColumnName]), null);
                            }
                            else if (proper.PropertyType == typeof(string))
                            {
                                proper.SetValue(objKUOC, Convert.ToString(drv[dtl.ColumnName]), null);
                            }
                        }
                    }
                    lstDuThu.Add(objKUOC);
                }
                LoadGridKheUoc();
            }
            Cursor = Cursors.Arrow;
        }