Exemplo n.º 1
0
 protected void Pay_Click(object sender, EventArgs e)
 {
     ServiceJsonHelper.PayBill((string)Session["customerId"], ((Bill)Session["customerBill"]).currentBill.BillDate);
     Pay.Visible      = false;
     LabelPay.Visible = true;
     LabelPay.Text    = "Thank you for online payment";
 }
        protected void btnCancelOrder_Click(object sender, EventArgs e)
        {
            int i = ServiceJsonHelper.CancelOrder(DropDownList1.SelectedItem.Value);

            if (i == 1)
            {
                string cid = (string)Session["customerId"];
                p = Profile.GetUserProfile(cid);
                List <string> orderId = new List <string>();
                if (p != null)
                {
                    foreach (OrderWrapper orders in p.Orders)
                    {
                        if (orders.Status != "cancelled")
                        {
                            orderId.Add(orders.Id);
                        }
                    }

                    DropDownList1.DataSource = orderId;
                    DropDownList1.DataBind();
                }
                else
                {
                    Response.Write("The order dint get cancelled!Please Try again later");
                }
            }
        }
Exemplo n.º 3
0
 public static bool TryRegister(User user)
 {
     if (DataAccessHelper.IsUserNameAvailable(user.Username) && DataAccessHelper.IsCustomerIdAvailable(user.CustomerId))
     {
         if (ServiceJsonHelper.PullProfile(user.CustomerId) != null)
         {
             DataAccessHelper.RegisterUser(user);
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public static Bill GetUserBill(string customerId)
 {
     return(ServiceJsonHelper.GetBill(customerId));
 }
Exemplo n.º 5
0
 public static void ChangeDueDate(string orderId, string newDate)
 {
     ServiceJsonHelper.ChangeDueDate(orderId, newDate);
 }
Exemplo n.º 6
0
 public static int CancelOrder(string orderId)
 {
     return(ServiceJsonHelper.CancelOrder(orderId));
 }
Exemplo n.º 7
0
 public static Profile GetUserProfile(string customerId)
 {
     return(ServiceJsonHelper.PullProfile(customerId));
 }