public LogoGeneral(DataGridView dataGrid) //The body method of the class { ExcelWrite excel = new ExcelWrite(); var sonuclar = GetTable("Information"); BeginNumber(sonuclar, "191"); // it takes only the rows that "Hesap Kodu" begins with 191 String str; //declared to take "Açıklama" into a more readable variable for (int i = 0; i < sonuclar.Rows.Count; i++) { str = sonuclar.Rows[i]["Açıklama"].ToString(); // get the "Açıklama" column into the variable if (str.Contains("Satınalma")) // does not do anything, it passes over... { continue; } //if we have one of these in "Açıklama" column, BillType() func. will split it into related columns else if (str.Contains("FT") || str.Contains("MK") || str.Contains("DK") || str.Contains("NOTER MAKBUZU") || str.Contains("SMM") || str.Contains("AVANS HARCAMASI") || str.Contains("MAKBUZ NO") || str.Contains("SF") || str.Contains("FİŞ") || str.StartsWith("KK")) { BillType(sonuclar, i); } //else {] DoNothingWithTheDataForNow(); //does the calculation for "Tutar" column (Tutar=Borç-Alacak) sonuclar.Rows[i]["Tutar"] = Double.Parse(sonuclar.Rows[i]["Borç"].ToString()) - Double.Parse(sonuclar.Rows[i]["Alacak"].ToString()); //does the calculation for "İşlem Döviz Borç" and "İşlem Döviz Alacak" columns according to "İşlem Döviz Bakiye" column if (Double.Parse(sonuclar.Rows[i]["İşlem Döviz Bakiye"].ToString()) > 0) { sonuclar.Rows[i]["İşlem Döviz Borç"] = sonuclar.Rows[i]["İşlem Döviz Bakiye"]; sonuclar.Rows[i]["İşlem Döviz Alacak"] = 0; } else { sonuclar.Rows[i]["İşlem Döviz Alacak"] = sonuclar.Rows[i]["İşlem Döviz Bakiye"]; sonuclar.Rows[i]["İşlem Döviz Borç"] = 0; } //does the calculation for "İşlem Döviz Tutar" column (İşlem Döviz Tutar = İşlem Döviz Borç - İşlem Döviz Alacak) sonuclar.Rows[i]["İşlem Döviz Tutar"] = Double.Parse(sonuclar.Rows[i]["İşlem Döviz Borç"].ToString()) - Double.Parse(sonuclar.Rows[i]["İşlem Döviz Alacak"].ToString()); //does the calculation for "Döviz Kur" column //it may be a wrong calculation // Döviz Kur = Borç/Bakiye ?? sonuclar.Rows[i]["Döviz Kur"] = Double.Parse(sonuclar.Rows[i]["Borç"].ToString()) / Double.Parse(sonuclar.Rows[i]["Bakiye"].ToString()); if (str.StartsWith("Devreden")) //Deletes the row if "Açıklama" begins with "Devreden" { sonuclar.Rows[i].Delete(); } } sonuclar.AcceptChanges(); //excel.ExcelWritten(sonuclar,"Logo Genel"); dataGrid.DataSource = sonuclar; }
//Herşey Burda Çalışır. public void logoAccountingFront(DataGridView dataGrid) { ExcelWrite excel = new ExcelWrite(); var sonuclar = GetTable("Information"); BeginNumber(sonuclar, "191"); CommentSplit(sonuclar); //excel.ExcelWritten(sonuclar, "Logo Ön Modül"); dataGrid.DataSource = sonuclar; }