public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_KTNB_08 rpt = new rpt_KTNB_08(); rpt.Site = this.Site; return(rpt); }
private void btnOk_Click(object sender, RoutedEventArgs e) { try { cls.ClsConnect(); string pos = CboPos.SelectedValue.ToString().Trim(); string thang = dtpNgay.SelectedDate.Value.Month.ToString(); string nam = dtpNgay.SelectedDate.Value.ToString("yyyy"); string cap = var2; //if (Opt1.IsChecked == true) cap = "1";else cap = "2"; if (KyBC == "1") { foreach (DataRow dr in dt.Rows) { string strup = "update LUUKTNB01 set COT3='" + dr["COT3"] + "',COT4='" + dr["COT4"] + "',COT5='" + dr["COT5"] + "',COT6='" + dr["COT6"] + "',COT7='" + dr["COT7"] + "',COT8='" + dr["COT8"] + "',COT9='" + dr["COT9"] + "',COT10='" + dr["COT10"] + "',COT11='" + dr["COT11"] + "',COT12='" + dr["COT12"] + "',COT13='" + dr["COT13"] + "',COT14='" + dr["COT14"] + "',COT15='" + dr["COT15"] + "',COT16='" + dr["COT16"] + "',COT17='" + dr["COT17"] + "',COT18='" + dr["COT18"] + "',GHICHU='" + dr["GHICHU"] + "' where POS='" + pos + "' and thang='" + thang + "' and nam='" + nam + "' and cap='" + cap + "' and KT_KHOA='" + dr["KT_KHOA"] + "' and MAU='" + Mau + "'"; //MessageBox.Show(strup); cls.UpdateDataText(strup); } MessageBox.Show("Lưu thành công !", "Mess", MessageBoxButton.OK, MessageBoxImage.Information); } int thamso = 5; string[] bien = new string[thamso]; object[] giatri = new object[thamso]; bien[0] = "@MaPos"; giatri[0] = s.Left(CboPos.SelectedValue.ToString().Trim(), 6); bien[1] = "@Ngay"; if (dtpNgay.SelectedDate != null) { giatri[1] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd"); } bien[2] = "@Cap"; giatri[2] = var2; //if (Opt1.IsChecked == true) giatri[2] = "1"; //else giatri[2] = "2"; bien[3] = "@Mau"; giatri[3] = Mau; bien[4] = "@KyBC"; giatri[4] = KyBC; var _dt = cls.LoadDataProcPara("usp_UpKTNB08", bien, giatri, thamso); rpt_KTNB_08 rpt = new rpt_KTNB_08(); RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); LblGetData_OnMouseDown(null, null); /* * MessageBox.Show(strin); * var dtin =cls.LoadDataText(strin); * Xtra_KTNB_06 rpt = new Xtra_KTNB_06();//xtra_KTNB_06 rpt = new xtra_KTNB_06(); * rpt.DataSource = dtin; * rpt.DataMember = rpt.DataMember; * rpt.ShowPreviewDialog(); */ } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } cls.DongKetNoi(); }