Esempio n. 1
0
 protected void btnNaarProd_Click(object sender, EventArgs e)
 {
     try
     {
         ShoppingCartManager cart   = new ShoppingCartManager();
         FacadeManager       facade = new FacadeManager();
         if (Session["orderid"] != null)
         {
             cart.OrderID = Session["orderid"].ToString();
             HCustomers hUser = (HCustomers)Session["userrole"];
             if (ViewState[userType] != null && hUser != null)
             {
                 facade.ConfirmOrder(cart, "P");
                 // insert toedm and basematerial
                 int       IsEDM          = 0;
                 int       IsBaseMaterial = 0;
                 DataTable ItemTable      = new DataTable();
                 ItemTable = new FacadeManager().GetAllItemForOrder(int.Parse(cart.OrderID));
                 if (ItemTable.Rows.Count > 0)
                 {
                     foreach (DataRow row in ItemTable.Rows)
                     {
                         IsEDM = Convert.ToInt32(row["to_edm"].ToString());
                         if (IsEDM == 1)
                         {
                             // insert EDM
                             int res = InsertEDMData(hUser);
                         }
                         IsBaseMaterial = Convert.ToInt32(row["to_products"].ToString());
                         if (IsBaseMaterial == 1)
                         {
                             // insert into BaseMaterial
                             int res = InsertBaseMaterialData(hUser);
                         }
                     }
                 }
                 if (chkConfirmation.Checked) // if confirmation checkbox selected then send Order Finalize mail to customer.
                 {
                     string    orderid  = Session["orderid"] != null ? Session["orderid"].ToString() : "Order ID Could not retrieve";
                     string    heyEmail = ConfigurationManager.AppSettings["hey-admin-mail"];
                     EmailInfo eInfo    = new EmailInfo();
                     eInfo.Email = hUser.Email;
                     string msg = "Product purchase order finalized.<br /> Order ID : " + orderid +
                                  "<br/> Total Amount: " + lblTotal.Text +
                                  "<br/> Product Discount: " + lblProductDiscout.Text +
                                  "<br/> Other Discount: " + lblOtherDiscount.Text +
                                  "<br/> Shipping Cost: " + lblShippingCost.Text +
                                  "<br/> Total Amount (Including vat): " + lblTotalIncludingVat.Text +
                                  "<br/><br/> With kind regards,<br/><a href='new.hey-ermelo.nl'>HEY</a>";
                     bool success = new FacadeManager().OrderFinalizeMailToCustomer(eInfo, heyEmail, msg);
                 }
                 ManageSession();
                 Response.Redirect("Home.aspx");
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 2
0
 protected void btnPlaceOffer_Click(object sender, EventArgs e)
 {
     try
     {
         ShoppingCartManager cart   = new ShoppingCartManager();
         FacadeManager       facade = new FacadeManager();
         if (Session["orderid"] != null)
         {
             cart.OrderID = Session["orderid"].ToString();
             facade.ConfirmOrder(cart, "B");
             HCustomers hUser = (HCustomers)Session["userrole"];
             if (hUser != null)
             {
                 string orderid  = Session["orderid"] != null ? Session["orderid"].ToString() : "Order ID Could not retrieve";
                 string heyEmail = ConfigurationManager.AppSettings["hey-admin-mail"];
                 string msg      = "Product purchase order submitted.<br /> Order ID : " + orderid + "<br/> Total Amount: " + lblTotal.Text +
                                   "<br/><br/> With kind regards,<br/>" + hUser.Email;;
                 EmailInfo eInfo = new EmailInfo();
                 eInfo.Email = hUser.Email;
                 bool success = new FacadeManager().OrderConfirmationMailToAdmin(eInfo, heyEmail, msg);
             }
             ManageSession();
             Response.Redirect("Home.aspx");
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 3
0
 protected void btnAdmOffer_Click(object sender, EventArgs e)
 {
     try
     {
         ShoppingCartManager cart   = new ShoppingCartManager();
         FacadeManager       facade = new FacadeManager();
         if (Session["orderid"] != null)
         {
             cart.OrderID = Session["orderid"].ToString();
             facade.ConfirmOrder(cart, "O");
             HCustomers hUser = (HCustomers)Session["userrole"];
             if (hUser != null)
             {
                 if (chkConfirmation.Checked) // if confirmation checkbox selected then send Order Confirmation mail to customer.
                 {
                     string orderid  = Session["orderid"] != null ? Session["orderid"].ToString() : "Order ID Could not retrieve";
                     string heyEmail = ConfigurationManager.AppSettings["hey-admin-mail"];
                     string msg      = "Product purchase offer submitted.<br /> Order ID : " + orderid +
                                       "<br/> Total Amount: " + lblTotal.Text +
                                       "<br/> Product Discount: " + lblProductDiscout.Text +
                                       "<br/> Other Discount: " + lblOtherDiscount.Text +
                                       "<br/> Shipping Cost: " + lblShippingCost.Text +
                                       "<br/> Total Amount (Including vat): " + lblTotalIncludingVat.Text +
                                       "<br/><br/> With kind regards,<br/><a href='new.hey-ermelo.nl'>HEY</a>";
                     EmailInfo eInfo = new EmailInfo();
                     eInfo.Email = hUser.Email;
                     bool success = new FacadeManager().OrderConfirmationToCustomer(eInfo, heyEmail, msg);
                 }
             }
             ManageSession();
             Response.Redirect("Home.aspx");
         }
     }
     catch (Exception ex)
     {
     }
 }