private void btnIskontoUygula_Click(object sender, EventArgs e) { if (ISKONTO.IsNotEmpty() && anaForm != null) { if (iskontoTip == 0) { anaForm.IskontoUygula("T", ISKONTO.GetDoubleData(), adisyonRecID); } else { anaForm.IskontoUygula("Y", ISKONTO.GetDoubleData(), adisyonRecID); } double tutar = 0.0; foreach (DataGridViewRow row in grdAdisyon.Rows) { tutar += Convert.ToDouble(row.Cells["grdTutar"].Value.ToString()); } lblSecimTutar.Text = (tutar - anaForm.GetIskT()).ToString("#,##0.00"); if (ODENEN.IsNotEmpty()) { PARA_USTU.SetDoubleData(ODENEN.GetDoubleData() - (tutar - anaForm.GetIskT())); } } }
private void btnNumpad_Click(object sender, EventArgs e) { List <string> numpadList = new List <string>(); numpadList.Add("0"); numpadList.Add("1"); numpadList.Add("2"); numpadList.Add("3"); numpadList.Add("4"); numpadList.Add("5"); numpadList.Add("6"); numpadList.Add("7"); numpadList.Add("8"); numpadList.Add("9"); numpadList.Add(","); if (((ODENEN.Text.ToString().BeforeChr(',').Length == 8 || ODENEN.Text.ToString().AfterChr(',').Length == 2) && numpadList.Contains((sender as SimpleButton).Tag.ToString())) && (sender as SimpleButton).Tag.ToString() != "<") { return; } double toplaDeger = 0; switch ((sender as SimpleButton).Tag.ToString()) { case "0": if (ODENEN.Text != "0") { ODENEN.Text += "0"; } break; case "1": ODENEN.Text += "1"; break; case "2": ODENEN.Text += "2"; break; case "3": ODENEN.Text += "3"; break; case "4": ODENEN.Text += "4"; break; case "5": ODENEN.Text += "5"; break; case "6": ODENEN.Text += "6"; break; case "7": ODENEN.Text += "7"; break; case "8": ODENEN.Text += "8"; break; case "9": ODENEN.Text += "9"; break; case ",": if (!ODENEN.Text.Contains(',') && ODENEN.Text.Length != 0) { ODENEN.Text += ","; } break; case "5TL": toplaDeger = 5; break; case "10TL": toplaDeger = 10; break; case "20TL": toplaDeger = 20; break; case "50TL": toplaDeger = 50; break; case "100TL": toplaDeger = 100; break; case "200TL": toplaDeger = 200; break; case "<": if (ODENEN.Text != "") { string text = ODENEN.Text.Replace(".", ""); if (text.Length != 1) { ODENEN.Text = text.Substring(0, text.Length - 1); } else { ODENEN.Text = ""; } } break; } double deger = 0.0; if (ODENEN.Text != "") { deger = Convert.ToDouble(ODENEN.Text.Replace(".", "")); } if (toplaDeger != 0.0) { deger += toplaDeger; } if (lblSecimTutar.Text != "0,00") { double secimTutar = Convert.ToDouble(lblSecimTutar.Text.Replace(".", "")); if (deger > secimTutar) { PARA_USTU.SetDoubleData(deger - secimTutar); } else { PARA_USTU.Text = ""; } } if (ODENEN.Text.Contains(',')) { if (ODENEN.Text.ToString().AfterChr(',').Length == 2) { ODENEN.Text = deger.ToString("#,###.##"); } else if (ODENEN.Text.ToString().AfterChr(',').Length == 1) { ODENEN.Text = deger.ToString("#,###.#"); } } else { ODENEN.Text = deger.ToString("#,###"); } }