protected void btnSubmit_Click(object sender, EventArgs e) { if (Session["OrderId"] != null) { Orders objOrder = new Orders(); objOrder.OrderID = long.Parse(Session["OrderId"].ToString()); objOrder.Status = "Success"; objOrder.OrderAmount = float.Parse(lblAmount.Text); objOrder.UpdateOrderStatus(); if (Chk.Checked) { string Pts = new Utilities().GetResultForQueryfromDB("select ISNULL(SUM(Points), 0) - (select ISNULL(sum(Points), 0) from ReedemPoints where Type = 'Debit' and UserID = " + Session["UserAccountID"].ToString() + ") from ReedemPoints where Type = 'credit' and UserID = " + Session["UserAccountID"].ToString()); ReedemPoints objR = new ReedemPoints(); objR.UserID = long.Parse(Session["UserAccountID"].ToString()); objR.OrderType = "Booking"; objR.Type = "Debit"; objR.Points = long.Parse(Pts); objR.SaveRecord(); } ReedemPoints objCR = new ReedemPoints(); objCR.UserID = long.Parse(Session["UserAccountID"].ToString()); objCR.OrderType = "Booking"; objCR.Type = "Credit"; objCR.Points = long.Parse(Math.Round(double.Parse(lblPaymentAmt.Text)).ToString()); objCR.SaveRecord(); Session["OrderId"] = null; Session["count"] = null; Response.Redirect("MyOrderStatus.aspx"); } }
public string SaveNewUser(string firstname, string lastname, string emailid, string pswrd, string mobileno) { string result = ""; try { if (!new UserAccounts().IsEmailAvailable(emailid)) { UserAccounts uaobj = new UserAccounts(); uaobj.Firstname = firstname; uaobj.LastName = lastname; uaobj.EmailID = emailid; uaobj.Password = "******"; uaobj.Role = "User"; uaobj.MobileNo = long.Parse(mobileno); long i = uaobj.SaveRecord(); if (i != 0) { ReedemPoints objR = new ReedemPoints(); objR.UserID = i; objR.OrderType = "Registration"; objR.Type = "Credit"; objR.Points = 50; objR.SaveRecord(); } result = "Success"; } else { result = "Already user has been registerd"; } } catch (Exception ex) { result = ""; } return(result); }