public void mustericariListele() { chSqlDataSource1.SelectCommand = "SELECT T1.[SN] ,T1.[TCNO_VERGINO] ,T1.[DEFINITION_] ,T1.[DATE_] ,T1.[FIS_TURU] ,T1.[TRANNO] ,T1.[LINEEXP] ,T1.[BORÇ] ,T1.[ALACAK] ,T1.[TRADINGGRP], '' AS BAKİYE FROM [CAGLAYAN_WEB].[dbo].[WEB_MUSHAR] T1 WHERE DEFINITION_='" + Session["musterikim"].ToString() + "' UNION ALL SELECT '','','', DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,GETDATE())+1,0))) ,'TOPLAM','','',SUM(BORÇ),SUM(ALACAK),'','' FROM WEB_MUSHAR WHERE DEFINITION_='" + Session["musterikim"].ToString() + "' GROUP BY TCNO_VERGINO ORDER BY DATE_"; chGridView1.DataBind(); chsatirToplam(); bakiyeGoster(); pdfGizle(); uyariGoster(); } public void bakiyeGoster() { if (chGridView1.Rows.Count == 0) { } else { for(int i= 0; i<chGridView1.Rows.Count;i++) { if (i == 0) { float borc = float.Parse(chGridView1.Rows[0].Cells[7].Text); float alacak = float.Parse(chGridView1.Rows[0].Cells[8].Text); chGridView1.Rows[0].Cells[9].Text = (borc - alacak).ToString("0,###.00"); } else { float borc = float.Parse(chGridView1.Rows[i].Cells[7].Text); float alacak = float.Parse(chGridView1.Rows[i].Cells[8].Text); float onceki = float.Parse(chGridView1.Rows[i - 1].Cells[9].Text); chGridView1.Rows[i].Cells[9].Text = (borc - alacak + onceki).ToString("0,###.00"); } } chGridView1.Rows[chGridView1.Rows.Count - 1].Cells[2].Text = ""; chGridView1.Rows[chGridView1.Rows.Count - 1].Cells[9].Text = chGridView1.Rows[chGridView1.Rows.Count - 2].Cells[9].Text; } } public void chsatirToplam() { for (int i = 0; i < chGridView1.Rows.Count; i++) { if (chGridView1.Rows[i].Cells[3].Text == "TOPLAM") { chGridView1.Rows[i].BackColor = System.Drawing.Color.FromName("#336666"); chGridView1.Rows[i].ForeColor = System.Drawing.Color.White; chGridView1.Rows[i].Cells[7].CssClass = "kenarlik"; chGridView1.Rows[i].Cells[8].CssClass = "kenarlik"; chGridView1.Rows[i].Cells[9].CssClass = "kenarlik"; chGridView1.Rows[i].Font.Bold = true; } else { } } }
Sql Yürüyen Bakiye (C# ile Bakiye Hesabı)
Kaydol:
Kayıtlar (Atom)
Hiç yorum yok:
Yorum Gönder