Exemplo n.º 1
0
        private void LoadgrdDSLoaiTK()
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                DataTable dt = null;
                LDatatable.MakeParameterTable(ref dt);


                LDatatable.AddParameter(ref dt, "@INP_USER", "string", ClientInformation.TenDangNhap);
                LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "string", ClientInformation.MaDonVi);
                LDatatable.AddParameter(ref dt, "@StartRow", "INT", StartRow.ToString());
                LDatatable.AddParameter(ref dt, "@EndRow", "INT", EndRow.ToString());

                Presentation.Process.KhaiThacDuLieuProcess process = new Presentation.Process.KhaiThacDuLieuProcess();
                DataSet ds = process.GetDanhSachLoaiTK(dt);
                if (ds != null && ds.Tables.Count > 0)
                {
                    grdDSLoaiTK.ItemsSource = ds.Tables[0].DefaultView;
                }
                else
                {
                    grdDSLoaiTK.ItemsSource = null;
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }

            Mouse.OverrideCursor = Cursors.Arrow;
        }
Exemplo n.º 2
0
        private void LoadCheckBox(string maLoaiTK, string maTK)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                DataTable dt = null;
                LDatatable.MakeParameterTable(ref dt);


                LDatatable.AddParameter(ref dt, "@INP_USER", "string", ClientInformation.TenDangNhap);
                LDatatable.AddParameter(ref dt, "@MA_DVI_QLY", "string", ClientInformation.MaDonVi);
                LDatatable.AddParameter(ref dt, "@StartRow", "INT", StartRow.ToString());
                LDatatable.AddParameter(ref dt, "@EndRow", "INT", EndRow.ToString());
                LDatatable.AddParameter(ref dt, "@INP_USER", "string", ClientInformation.TenDangNhap);
                LDatatable.AddParameter(ref dt, "@MA_LOAITK", "string", maLoaiTK);
                LDatatable.AddParameter(ref dt, "@MATK", "string", maTK);

                Presentation.Process.KhaiThacDuLieuProcess process = new Presentation.Process.KhaiThacDuLieuProcess();
                DataSet ds = process.GetDanhSachMapping(dt);
                grdDSDKien.UnselectAll();

                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    List <DataRowView> lstDr = new List <DataRowView>();
                    for (int i = 0; i < grdDSDKien.Items.Count; i++)
                    {
                        DataRowView dr = (DataRowView)grdDSDKien.Items[i];
                        for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                        {
                            if (dr["MA_DKIEN"].ToString().Equals(ds.Tables[0].Rows[j]["MA_MAPPING"]))
                            {
                                lstDr.Add(dr);
                            }
                        }
                    }
                    grdDSDKien.Select(lstDr);
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }

            Mouse.OverrideCursor = Cursors.Arrow;
        }
Exemplo n.º 3
0
        private void LoadgrdDSDKien(string dkien)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                Presentation.Process.KhaiThacDuLieuProcess process = new Presentation.Process.KhaiThacDuLieuProcess();
                DataSet ds = process.GetDanhSachDKien(dkien);
                if (ds != null && ds.Tables.Count > 0)
                {
                    grdDSDKien.ItemsSource = ds.Tables[0].DefaultView;
                }
                else
                {
                    grdDSDKien.ItemsSource = null;
                }
            }
            catch (Exception ex)
            {
                CommonFunction.ThongBaoLoi(ex);
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }

            Mouse.OverrideCursor = Cursors.Arrow;
        }