public virtual void Fill() { this.PreFill(); this.dsS_DD_IPPDataSet1 = new S_DD_IPPDataSet(); this.m_StartRow = 0; this.Cursor = Cursors.WaitCursor; this.m_GridLoading = true; ThreadPool.QueueUserWorkItem(new WaitCallback(this.FillDataThread), Thread.CurrentPrincipal); }
public void OtvoriObracun_Za_Mjesec() { SqlConnection connection = new SqlConnection { ConnectionString = Configuration.ConnectionString }; frmPregledMjeseciGodina godina = new frmPregledMjeseciGodina(); godina.ShowDialog(); if (godina.DialogResult != DialogResult.Cancel) { DataRow row = null; string str = string.Empty; string str2 = string.Empty; string str3 = string.Empty; if ((godina.OdabraniGodinaIsplate != null) & (godina.OdabraniMjesecIsplate != null)) { this.ds.Clear(); this.por.Clear(); this.mjesecisplate = Conversions.ToString(godina.OdabraniMjesecIsplate); this.godinaisplate = Conversions.ToString(godina.OdabraniGodinaIsplate); this.da.Fill(this.ds, Conversions.ToString(godina.OdabraniMjesecIsplate), Conversions.ToString(godina.OdabraniGodinaIsplate)); DataRow row2 = this.por.porez.NewRow(); row2["rbr"] = 1; row2["vrsta"] = "Plaća"; row2["broj"] = DB.N20(RuntimeHelpers.GetObjectValue(this.ds.S_OD_IPP.Rows[0]["brojradnika"])); if ((Conversions.ToInteger(godina.OdabraniGodinaIsplate) >= 0x7da) & (Conversions.ToInteger(godina.OdabraniMjesecIsplate) >= 7)) { row2["osnovica"] = DB.RoundUP(Convert.ToDouble(DB.N20(RuntimeHelpers.GetObjectValue(this.ds.S_OD_IPP.Rows[0]["krizniporez"]))) / 0.04); row2["porez"] = DB.N20(RuntimeHelpers.GetObjectValue(this.ds.S_OD_IPP.Rows[0]["krizniporez"])); } else { row2["osnovica"] = DB.N20(RuntimeHelpers.GetObjectValue(this.ds.S_OD_IPP.Rows[0]["osnovicakriznogporeza"])); row2["porez"] = DB.N20(RuntimeHelpers.GetObjectValue(this.ds.S_OD_IPP.Rows[0]["krizniporez"])); } this.por.porez.Rows.Add(row2); S_DD_IPPDataAdapter adapter2 = new S_DD_IPPDataAdapter(); S_DD_IPPDataSet set2 = new S_DD_IPPDataSet(); adapter2.Fill(set2, DB.BrojVodeceNule(RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate), 2, 0, false, ""), Conversions.ToString(godina.OdabraniGodinaIsplate)); row = this.por.porez.NewRow(); row["rbr"] = 3; row["vrsta"] = "Drugi dohodak"; row["broj"] = DB.N20(RuntimeHelpers.GetObjectValue(set2.S_DD_IPP.Rows[0]["brojradnika"])); if ((Conversions.ToInteger(godina.OdabraniGodinaIsplate) >= 0x7da) & (Conversions.ToInteger(godina.OdabraniMjesecIsplate) >= 7)) { row["osnovica"] = DB.RoundUP(Convert.ToDouble(DB.N20(RuntimeHelpers.GetObjectValue(set2.S_DD_IPP.Rows[0]["krizniporez"]))) / 0.04); row["porez"] = DB.N20(RuntimeHelpers.GetObjectValue(set2.S_DD_IPP.Rows[0]["krizniporez"])); } else { row["osnovica"] = DB.N20(RuntimeHelpers.GetObjectValue(set2.S_DD_IPP.Rows[0]["osnovicakriznogporeza"])); row["porez"] = DB.N20(RuntimeHelpers.GetObjectValue(set2.S_DD_IPP.Rows[0]["krizniporez"])); } this.por.porez.Rows.Add(row); } row = this.por.porez.NewRow(); row["rbr"] = 2; row["vrsta"] = "Mirovina"; row["broj"] = 0; row["osnovica"] = 0.0; row["porez"] = 0.0; this.por.porez.Rows.Add(row); row = this.por.porez.NewRow(); row["rbr"] = 4; row["vrsta"] = "Dividende i udjeli u dobiti"; row["broj"] = 0; row["osnovica"] = 0.0; row["porez"] = 0.0; this.por.porez.Rows.Add(row); KORISNIKDataSet dataSet = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(dataSet); ReportDocument document = new ReportDocument(); document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptIPP.rpt"); document.SetDataSource(this.por); if (dataSet.KORISNIK.Rows.Count > 0) { str3 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"]); str = string.Format("{0}, {1}", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1ADRESA"]), RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); str2 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KORISNIKOIB"]); } document.SetParameterValue("ustanova", str3); document.SetParameterValue("adresa", str); document.SetParameterValue("mb", str2); document.SetParameterValue("datum", DateTime.Today); document.SetParameterValue("mjesec_ime", DB.MjesecNazivDativ(Conversions.ToInteger(this.mjesecisplate)).ToUpper()); document.SetParameterValue("godina", this.godinaisplate + "."); this.CrystalReportViewer1.ReportSource = document; } }