protected void Button1_Click(object sender, EventArgs e) { Panel1.Visible = false; Panel2.Visible = false; return_ ret = new return_(); string name = ret.bal_(Acc.Value, "", 2); if (name.Equals("none")) { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Unique Id doesnot exist "; } else if (!Text1.Value.Equals(Session["unid"].ToString())) { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Please enter your correct unique id "; } else { int cash = Int32.Parse(money.Text) - Int32.Parse(AddMoney.Value); if (cash > 0) { add_money money1 = new add_money(Acc.Value, Int32.Parse(AddMoney.Value), 0); SqlConnection cn = new SqlConnection(); cn.ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["cnstring"].ToString(); cn.Open(); string str12 = "update signup set wallet =wallet-" + Int32.Parse(AddMoney.Value) + " where unid='" + Session["unid"].ToString() + "' "; SqlCommand cmd = new SqlCommand(str12, cn); cmd.ExecuteNonQuery(); cn.Close(); transaction tra = new transaction(Session["unid"].ToString(), "Transfered Rs " + AddMoney.Value + " to " + name + " (" + Acc.Value + ")", 2); notification noyi = new notification(Session["unid"].ToString(), Acc.Value, Label1.Text + " (" + Session["unid"].ToString() + ") Transfered Rs " + AddMoney.Value, 1); Panel1.Visible = false; Panel2.Visible = true; } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "You have insufficient balance"; } } }
protected void Button1_Click(object sender, EventArgs e) { Panel1.Visible = false; Panel2.Visible = false; return_ ret = new return_(); string bal = ret.bal_(Acc.Value, pass.Value, 1); if (bal == "none") { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Credentials are wrong "; } else { int new_bal = Int32.Parse(bal) - Int32.Parse(AddMoney.Value); if (new_bal >= 0) { add_money money = new add_money(Session["unid"].ToString(), Int32.Parse(AddMoney.Value), 0); SqlConnection cn = new SqlConnection(); cn.ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["cnstring"].ToString(); cn.Open(); string str12 = "update banker set bal =bal-" + Int32.Parse(AddMoney.Value) + " where accno='" + Acc.Value + "' "; SqlCommand cmd = new SqlCommand(str12, cn); cmd.ExecuteNonQuery(); cn.Close(); transaction tra = new transaction(Session["unid"].ToString(), "Transfered Rs " + AddMoney.Value + " from account no " + Acc.Value, 1); Panel1.Visible = false; Panel2.Visible = true; } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Your bank has insufficient balance"; } } }
protected void Button1_Click(object sender, EventArgs e) { Panel1.Visible = false; Panel2.Visible = false; return_ ret = new return_(); string bal = ret.bal_(Acc.Value, Text1.Value, 1); if (bal == "none") { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Credentials are wrong "; } else { int cash = Int32.Parse(money.Text) - Int32.Parse(AddMoney.Value); if (cash > 0) { add_money money1 = new add_money(Acc.Value, Int32.Parse(AddMoney.Value), 1); SqlConnection cn = new SqlConnection(); cn.ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["cnstring"].ToString(); cn.Open(); string str12 = "update signup set wallet =wallet-" + Int32.Parse(AddMoney.Value) + " where email='" + Session["email"].ToString() + "' "; SqlCommand cmd = new SqlCommand(str12, cn); cmd.ExecuteNonQuery(); cn.Close(); Panel1.Visible = false; Panel2.Visible = true; } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "You have insufficient balance"; } } }
protected void Button2_Click(object sender, EventArgs e) { Panel1.Visible = false; Panel2.Visible = false; int cash = Int32.Parse(money.Text) - Int32.Parse(AddMoney.Value); if (cash > 0) { if (Session["unid"].ToString() == Acc.Value) { add_money mon = new add_money(Session["unid"].ToString(), float.Parse(AddMoney.Value), 5); add_money mon1 = new add_money("gas", float.Parse(AddMoney.Value), 0); transaction tr = new transaction(Session["unid"].ToString(), "Gas is booked. Rs " + AddMoney.Value, 3); notification noti = new notification(Session["unid"].ToString(), "gas", "Gas booked from " + Label1.Text + ". Rs " + AddMoney.Value, 10); Panel2.Visible = true; Panel1.Visible = false; } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Incorrect Unique ID"; } } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "You have insufficient balance"; } }
protected void Button1_Click1(object sender, EventArgs e) { string temp = ""; float amount = 0; int status = 0; return_ re = new return_(); Panel1.Visible = false; Panel2.Visible = false; int cash = Int32.Parse(re.bal_(Session["unid"].ToString(), "", 3)) - Int32.Parse(AddMoney.Value); if (cash > 0) { if (coupon.Value.Length > 0) { temp = re.bal_(DropDownList1.SelectedValue.ToString(), coupon.Value, 7); if (temp != "none") { float discount = float.Parse(temp) / 100; amount = float.Parse(AddMoney.Value) - (float.Parse(AddMoney.Value) * discount); add_money limi = new add_money(coupon.Value, 1, 4); status = 4; } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "Invalid Coupon "; } } else { status = 5; amount = float.Parse(AddMoney.Value); } if (status == 4) { transaction tr = new transaction(Session["unid"].ToString(), "Recharge of Rs " + AddMoney.Value + ". Operator - " + DropDownList1.SelectedItem + ". Discount " + temp + "%" + ". Phone no - " + pno.Value + ".", status); notification noti = new notification(Session["unid"].ToString(), DropDownList1.SelectedValue, "Recharge from " + Label1.Text + " of Rs " + AddMoney.Value + ". Discount " + temp + "% " + ". Phone no - " + pno.Value + ".", 50); } else if (status == 5) { transaction tr = new transaction(Session["unid"].ToString(), "Recharge of Rs " + AddMoney.Value + ". Operator - " + DropDownList1.SelectedItem + ". Phone no - " + pno.Value + ".", status); notification noti = new notification(Session["unid"].ToString(), DropDownList1.SelectedValue, "Recharge from " + Label1.Text + " of Rs " + AddMoney.Value + ". Phone no - " + pno.Value + ".", 51); } if (status == 4 || status == 5) { add_money mon = new add_money(Session["unid"].ToString(), amount, 2); add_money mon1 = new add_money(DropDownList1.SelectedValue.ToString(), amount, 3); Panel2.Visible = true; Panel1.Visible = false; } } else { Panel1.Visible = true; Panel2.Visible = false; Label2.Text = "You have insufficient balance"; } }