public ActionResult Moneytransfer(transaction_table t) { if (ModelState.IsValid) { t.Transaction_Name = "MONEYTRANSFER"; t.Type = "BY CNIC"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); db.transaction_table.Add(t); if (db.SaveChanges() > 0) { Session["money"] = "MONEY TRANSFER SUCESSFULLY"; return(View()); } } else { Session["TRANSFER"] = "*ALL FIELDS MUST FILLED"; } return(View()); }
public ActionResult ACTIVATE(CallerTune c, transaction_table t) { if (ModelState.IsValid) { t.paymentmethod = c.payment_method; t.Transaction_Name = "CALLERTUNE"; t.Type = "SONGS"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); t.offer_recharge_consumer_numbers = c.TUNE_CODE; db.transaction_table.Add(t); if (db.SaveChanges() > 0) { c.payment_method = string.Empty; c.amount = string.Empty; c.Account_No = string.Empty; db.Entry(c).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); ModelState.Clear(); Session["TUNE"] = "CALLER TUNE SUCCESSFULLY ACTIVATED"; return(View()); } } else { Session["CALLER"] = "*ALL FIELDS MUST FILLED"; } return(View()); }
public ActionResult Edit(offer o, transaction_table t, loginfo l) { if (ModelState.IsValid) { t.Transaction_Name = "POSTPAIDBILL"; t.Type = "Postpaid"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); t.offer_recharge_consumer_numbers = o.offercode; db.transaction_table.Add(t); if (db.SaveChanges() > 0) { Session["offer"] = "OFFER GET SUCCESSFULLY"; o.Account_No = string.Empty; o.amount = string.Empty; o.mpin = string.Empty; db.Entry(o).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); ModelState.Clear(); l.Balance = l.Balance - t.amount; db.Entry(l).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } else { Session["BILL"] = "*ALL FIELDS MUST FILLED"; } return(View()); }
public ActionResult Editoffers(offers o, transaction_table t) { if (ModelState.IsValid) { t.mpin = "1122"; t.operators_ = o.Network; t.Transaction_Name = "Special Offers"; t.Type = o.Network; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); t.offer_recharge_consumer_numbers = o.Reciever_Mobile_No; t.paymentmethod = o.Payment_Methods; db.transaction_table.Add(t); if (db.SaveChanges() > 0) { o.Transaction_name = string.Empty; o.Type = o.Network; o.Payment_Methods = string.Empty; o.amount = string.Empty; o.Reciever_Mobile_No = string.Empty; o.account_no = string.Empty; db.Entry(o).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); ModelState.Clear(); Session["offers"] = "OFFER GETTED SUCCESSFULLY"; } } else { Session["OFF"] = "*ALL FIELDS MUST FILLED"; } return(View()); }
public ActionResult Deposit(loginfo l, transaction_table t) { if (ModelState.IsValid) { t.Account_No = l.accountno; t.offer_recharge_consumer_numbers = l.accountno; t.operators_ = "DEPOSIT THROUGH RECHARE.CO"; t.Transaction_Name = "Cash Depost"; t.Type = "Deposit"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); db.transaction_table.Add(t); if (db.SaveChanges() > 0) { l.password = l.password; l.confirm_password = l.confirm_password; l.mpin = l.mpin; Session["deposit"] = "depost successfully"; l.Balance = l.amount + l.Balance; db.Entry(l).State = System.Data.Entity.EntityState.Modified; l.amount = null; l.accountno = string.Empty; l.mpincheck = string.Empty; db.SaveChanges(); Session["Balance"] = l.Balance; } else { Session["deposit"] = null; } } return(View()); }
public ActionResult onlinerecharge(loginfo l, transaction_table t) { Session["RECHARGE"] = null; if (ModelState.IsValid) { if (l.paymentmethod == "RECHARGE.COM") { if (l.mpincheck == l.mpin) { if (l.Balance >= l.amount) { l.Balance = l.Balance - l.amount; db.Entry(l).State = System.Data.Entity.EntityState.Modified; l.accountno = t.Account_No; l.amount = null; l.accountno = string.Empty; l.mpincheck = string.Empty; l.offer_recharge_consumer_numbers = string.Empty; if (db.SaveChanges() > 0) { t.operators_ = l.operators; t.Account_No = l.Account_No; t.Transaction_Name = "Online Recharge"; t.Type = "Recharge"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); db.transaction_table.Add(t); db.SaveChanges(); Session["RECHARGE"] = "Recharge successfully"; Session["PIN"] = null; Session["er"] = null; ModelState.Clear(); } Session["Balance"] = l.Balance; } else { Session["er"] = " NOT ENOUGH BALANCE"; Session["PIN"] = null; Session["RECHARGE"] = null; } } else { Session["PIN"] = "MPIN IS INVALID"; Session["er"] = null; Session["RECHARGE"] = null; return(View()); } } else { t.Transaction_Name = "Online Recharge"; t.Type = "Recharge"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); db.transaction_table.Add(t); db.SaveChanges(); Session["RECHARGE"] = "Recharge successfully"; } } return(View()); }
public ActionResult Moneytransfer(transaction_table t, loginfo l) { Session["MONEY"] = null; if (ModelState.IsValid) { if (l.paymentmethod == "RECHARGE.COM") { if (l.mpincheck == l.mpin) { if (l.Balance >= l.amount) { l.Balance = l.Balance - l.amount; l.accountno = t.Account_No; db.Entry(l).State = System.Data.Entity.EntityState.Modified; l.amount = null; l.accountno = string.Empty; l.mpincheck = string.Empty; l.offer_recharge_consumer_numbers = string.Empty; if (db.SaveChanges() > 0) { t.Account_No = l.Account_No; t.Transaction_Name = "MONEY TRANSFER"; t.Type = "BY CNIC"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); db.transaction_table.Add(t); db.SaveChanges(); Session["MONEY"] = "MONEY TRANSFER SUCCESSFULLY"; Session["PIN"] = null; Session["ER"] = null; ModelState.Clear(); } Session["Balance"] = l.Balance; } else { Session["ER"] = " NOT ENOUGH BALANCE"; Session["MONEY"] = null; Session["PIN"] = null; } } else { Session["PIN"] = "MPIN IS INVALID"; Session["ER"] = null; Session["MONEY"] = null; return(View()); } } else { t.Account_No = l.Account_No; t.Transaction_Name = "MONEY TRANSFER"; t.Type = "BY CNIC"; t.time = System.DateTime.Now.ToShortTimeString(); t.date = System.DateTime.Now.ToShortDateString(); db.transaction_table.Add(t); db.SaveChanges(); Session["MONEY"] = "MONEY TRANSFER SUCCESSFULLY"; } } else { Session["TRANSFER"] = "*ALL FIELDS MUST FILLED"; } return(View()); }