示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_Nguon_UT rpt = new rpt_Nguon_UT();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
 private void BtnOk_OnClick(object sender, RoutedEventArgs e)
 {
     try
     {
         if (dtNew.Rows.Count > 0)
         {
             cls.ClsConnect();
             foreach (DataRow dr in dtNew.Rows)
             {
                 //MessageBox.Show(dr["NG_MATO"].ToString()+"      "+dr["A01"].ToString());
                 string strsql = "update NGUON_TT set A01=" + dr["A01"] + ",A02=" + dr["A02"] + ",A03=" +
                                 dr["A03"] + ",A03CS=" + dr["A03CS"] + ",A04=" + dr["A04"] + ",A06=" + dr["A06"] + ",A07=" + dr["A07"]
                                 + ",A08=" + dr["A08"] + ",A09=" + dr["A09"] + ",A10=" + dr["A10"] + ",A11=" +
                                 dr["A11"] + ",A15=" + dr["A15"] + ",A16=" + dr["A16"] + ",A17=" + dr["A17"] +
                                 ",A18=" + dr["A18"] + ",A19=" + dr["A19"] + ",B03T=" + dr["B03T"]
                                 + ",B03H=" + dr["B03H"] + ",B19T=" + dr["B19T"] + ",B19H=" + dr["B19H"] + ",TGXA=" + dr["TGXA"] + ",NG_TONG=" + dr["NG_TONG"]
                                 + " where NG_MAXA='" + dr["NG_MAXA"].ToString().Trim() + "'";
                 cls.UpdateDataText(strsql);
             }
             MessageBox.Show("Update Ok", "Mess", MessageBoxButton.OK, MessageBoxImage.Information);
             if (
                 MessageBox.Show("Có muốn in số liệu ra không ?", "Question", MessageBoxButton.YesNo,
                                 MessageBoxImage.Warning) == MessageBoxResult.Yes)
             {
                 cls.ClsConnect();
                 int      thamso = 1;
                 string[] bien   = new string[thamso];
                 object[] giatri = new object[thamso];
                 bien[0]   = "@MaPos";
                 giatri[0] = s.Left(CboPos.SelectedValue.ToString().Trim(), 6);
                 var          dtin = cls.LoadDataProcPara("usp_InNguon_TT", bien, giatri, thamso);
                 rpt_Nguon_UT rpt  = new rpt_Nguon_UT();
                 RPUtility.ShowRp(rpt, dtin, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
             }
             dtNew.Clear();
             //dgvTarGet.ItemsSource = dtNew.DefaultView;
         }
         else
         {
             MessageBox.Show("Xem lại. Chưa có dữ liệu", "Mess", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error \n" + ex.Message, "Mess", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally
     {
         cls.DongKetNoi();
     }
 }