//Event is for Admin who will plac order on customer behalf protected void btnProcC_Click(object sender, EventArgs e) { Thread.Sleep(7000); if (DataAccess.DBAccess.CheckAddressForRequestNo(requestId) == 0) { return; } string paymentLink = string.Empty; if (!string.IsNullOrEmpty(Request.QueryString["method"]) && Request.QueryString["method"] != "11" && Request.QueryString["method"] != "12" && Request.QueryString["method"] != "13" && Request.QueryString["method"] != "14") //It is for online only - should not be called in offline. 11 means offf line { DBAccess.SetUserByAdminOnBehalf(requestId, billing_name.Value, txtLastName.Value); //It is for online only - should not be called in offline. foreach (var name in Request.Form.AllKeys) { if (name != null) { if (!name.Contains("btnProcC")) { if (!name.Replace("ctl00$ContentPlaceHolder1$", "").StartsWith("_")) { ccaRequest = ccaRequest + name.Replace("ctl00$ContentPlaceHolder1$", "") + "=" + Request.Form[name] + "&"; /* Response.Write(name + "=" + Request.Form[name]); * Response.Write("</br>");*/ } } } } //if ( Request.QueryString["method"] == "11")//Off line //{ // Response.Redirect("ConfirmationPage.aspx?method=" + Request.QueryString["method"]+"&requestId"+Request.QueryString["requestId"]); //} //else //{ //Online //if (Session["USER"] != null) //{ ccaRequest = ccaRequest + "billing_email=" + txtLastName.Value + "&"; //Note : last name is using like email id //((User)Session["USER"]).email + "&"; //} ccaRequest = ccaRequest + "billing_country=India&"; ccaRequest = ccaRequest + "delivery_country=India&"; strEncRequest = ccaCrypto.Encrypt(ccaRequest, workingKey); if (Convert.ToInt32(ConfigurationManager.AppSettings["GoToPaymentGateway"]) == 1) { paymentLink = "http://www.kitchenonmyplate.com/ccavRequestHandler.aspx?requestId=" + requestId + "&ED=" + strEncRequest; } else { // Response.Redirect("Stub.aspx?requestId=" + requestId); paymentLink = "http://www.kitchenonmyplate.com/ccavRequestHandler.aspx?requestId=" + requestId + "&ED=" + strEncRequest; //window.location.href = "Stub.aspx?requestId=" + requestId; } // Response.Redirect("ccavRequestHandler.aspx?ED=" + strEncRequest); //window.location.href = "Stub.aspx?requestId=" + requestId; //} //else //{ // // Response.Redirect("ConfirmationPage.aspx?method=" + method + "&referanceNo=123&PaymentDone=0&requestId=" + requestId); //} //ShippingBilling objSB = DBAccess.GetShippingBilling(rqst); #region Send Mail string content = string.Empty; string filepath = "~/Email/Post.htm"; //New user StringBuilder sbContent = new StringBuilder(); StreamReader rdr = new StreamReader(HttpContext.Current.Server.MapPath(filepath)); string strLine = ""; while (strLine != null) { strLine = rdr.ReadLine(); if ((strLine != null) && (strLine != "")) { sbContent.Append("\n" + strLine); } } rdr.Close(); string site = ConfigurationManager.AppSettings["SiteName"].ToString(); content = sbContent.ToString(); //content = content.Replace("$REQ$", PostType); //content = content.Replace("$ID$", ID); var sbOff = new StringBuilder(); //divOff.RenderControl(new HtmlTextWriter(new StringWriter(sbOff))); content = content.Replace("$ORDERSUMMARY$", "Click on below link to complete your order!"); var sb = new StringBuilder(); //divFinal.RenderControl(new HtmlTextWriter(new StringWriter(sb))); content = content.Replace("$REQ$", "<a href='" + paymentLink + "' >Make Payment</a><br/><br/>Only single transaction is permitted with above link"); content = content.Replace("$NAME$", billing_name.Value); content = content.Replace("$SITE$", site); content = content.Replace("RobotoBlack", "Arial"); content = content.Replace("Roboto", "Arial"); content = content.Replace("RobotoBold", "Arial"); content = content.Replace("images/rs3.png", "http://www.kitchenonmyplate.com/images/rs3.png"); content = content.Replace("class", "style"); content = content.Replace("page-titleSmallCust", "color:#4b220c; text-transform:uppercase; font-family:'Arial'; font-weight:bold;border-bottom:1px solid #c8c6c6; padding:10px 0 10px 25px ; font-size:25px; margin-top:0px;background:#EEEEEE !important;"); content = content.Replace("OrderBox", "display:none"); content = content.Replace("ProcessBox", "width:100%;height:auto;border:1px solid #c8c6c6;padding-bottom:10px;"); content = content.Replace("ProcesBoxInner", "height:auto; padding:0px 25px 10px 10px;text-align: justify; text-justify: inter-word;"); content = content.Replace("tbl", "width:100%;height:auto;border:1px solid #c8c6c6;"); content = content.Replace("divRowHeader", "font-weight:bold; color:Black; font-size:0.85em;"); content = content.Replace("<table", "<table style='border-collapse:collapse; border-spacing:0;' "); content = content.Replace("price", "font-weight:700; font-size:1.2em; color: #006400;"); content = content.Replace("priceTotaltxt", "font-weight:700; font-size:24px; color: #006400;"); content = content.Replace("priceTotal", "font-size:30px; color: #006400; padding-right:25px;"); content = content.Replace("CUSTBOX", ""); content = content.Replace("emailH5", "font-size:14px;"); content = content.Replace("<i style='fa fa-inr'></i>", "Rs. "); content = content.Replace(">01<", ""); content = content.Replace(">03<", ""); if (!string.IsNullOrEmpty(txtLastName.Value)) //Note : last name is as emailid { MailHelper.SendMailMessage("", txtLastName.Value, string.Empty, string.Empty, "KOMP : Confirm your order", content); AutoServices.SendeMailToUs("Copy:KOMP : KOMP : Confirm your order", content); } #endregion Session.Remove("OrderList"); //Deleting cookies if (Request.Cookies["ORDERLIST"] != null) { HttpCookie myCookie = new HttpCookie("ORDERLIST"); myCookie.Expires = DateTime.Now.AddDays(-1d); Response.Cookies.Add(myCookie); } Response.Redirect("/"); } }
public int SavePayementDetails(Payment objPaymentHistory) { SqlTransaction transaction = null; try { if (objPaymentHistory.OrderId == 0) { //throw (new Exception("Please retrieve Customer ID")); return(0); } if (objPaymentHistory.Amount == 0) { //throw (new Exception("Please retrieve Customer ID")); return(0); } con = new SqlConnection(cs); con.Open(); transaction = con.BeginTransaction(IsolationLevel.ReadCommitted); String cbt = "select TotalPayment from [Order] where Id= '" + objPaymentHistory.OrderId + "'"; cmd = new SqlCommand(cbt); cmd.Connection = con; cmd.Transaction = transaction; decimal amt = Convert.ToDecimal(cmd.ExecuteScalar()); int paymenStatus = 2; if (objPaymentHistory.Amount >= amt) { paymenStatus = 1; //Paid } //string invoiceno = "INV-" + GetUniqueKey(8); //String cb = "update [Order] set IsActive='1', PaymentDone='" + paymenStatus + "',TotalPayment = TotalPayment + " + objPaymentHistory.Amount + " where Id= '" + objPaymentHistory.OrderId + "'"; String cb = "update [Order] set IsActive='1', PaymentDone='" + paymenStatus + "',TotalPayment = " + objPaymentHistory.Amount + " where Id= '" + objPaymentHistory.OrderId + "'"; //string cb = "insert Into Sales(InvoiceNo,InvoiceDate,CustomerID,SubTotal,VATPercentage,VATAmount,GrandTotal,TotalPayment,PaymentDue,Remarks) VALUES ('" + invoiceno + "','" + objInvoiceData.InvoiceItems[0].InvoiceDate + "','" + objInvoiceData.InvoiceItems[0].CustomerID + "'," + objInvoiceData.InvoiceItems[0].SubTotal + "," + objInvoiceData.InvoiceItems[0].VATPercentage + "," + objInvoiceData.InvoiceItems[0].VATAmount + "," + objInvoiceData.InvoiceItems[0].GrandTotal + "," + objInvoiceData.InvoiceItems[0].TotalPayment + "," + objInvoiceData.InvoiceItems[0].PaymentDue + ",'" + objInvoiceData.InvoiceItems[0].Remarks + "')"; cmd = new SqlCommand(cb); cmd.Connection = con; cmd.Transaction = transaction; cmd.ExecuteNonQuery(); //cb = "update [OrderDetails] set IsActive='1' where OrderId= '" + objPaymentHistory.OrderId + "'"; //cmd = new SqlCommand(cb); //cmd.Connection = con; //cmd.Transaction = transaction; //cmd.ExecuteNonQuery(); //if (con.State == ConnectionState.Open) //{ // con.Close(); //} //con.Close(); //Delete product //con = new SqlConnection(cs); //con.Open(); //string invoiceno = "INV-" + GetUniqueKey(8); //String cb1 = "insert from ProductSold where Invoiceno= '" + objInvoiceData.InvoiceItems[0].InvoiceNo + "'"; string cb1 = "update Payment set PaymentDate='" + objPaymentHistory.PaymentDate.Value.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToLocalTime().TimeOfDay.ToString().Substring(0, 12) + "', Mode='" + objPaymentHistory.Mode + "',TransactionNo='" + objPaymentHistory.TransactionNo + "',Bank='" + objPaymentHistory.Bank + "',Branch='" + objPaymentHistory.Branch + "',Comments='" + objPaymentHistory.Comments + "', IsActive=1 where Orderid='" + objPaymentHistory.OrderId + "'"; //string cb1 = "update Payment set Amount =Amount + " + objPaymentHistory.Amount + ",PaymentDate='" + objPaymentHistory.PaymentDate + "', Mode='" + objPaymentHistory.Mode + "',TransactionNo='" + objPaymentHistory.TransactionNo + "',IsActive=1 where Orderid='" + objPaymentHistory.OrderId + "'"; cmd = new SqlCommand(cb1); cmd.Connection = con; cmd.Transaction = transaction; cmd.ExecuteNonQuery(); transaction.Commit(); if (con.State == ConnectionState.Open) { con.Close(); } con.Close(); //TODO:LATER //for (int i = 0; i <= objInvoiceData.CartItems.Count - 1; i++) //{ // con = new SqlConnection(cs); // con.Open(); // string cb1 = "update stock set Quantity = Quantity - " + objInvoiceData.CartItems[i].Qty + " where ConfigID= " + objInvoiceData.CartItems[i].ConfigID + ""; // cmd = new SqlCommand(cb1); // cmd.Connection = con; // cmd.ExecuteNonQuery(); // con.Close(); //} //for (int i = 0; i <= objInvoiceData.CartItems.Count - 1; i++) //{ // con = new SqlConnection(cs); // con.Open(); // string cb2 = "update stock set TotalPrice = Totalprice - '" + objInvoiceData.CartItems[i].TotalAmount + "' where ConfigID= " + objInvoiceData.CartItems[i].ConfigID + ""; // cmd = new SqlCommand(cb2); // cmd.Connection = con; // cmd.ExecuteReader(); // con.Close(); //} String cbt1 = "select RequestId from [Order] where Id= '" + objPaymentHistory.OrderId + "'"; cmd = new SqlCommand(cbt1); con.Open(); cmd.Connection = con; //cmd.Transaction = transaction; int rqst = Convert.ToInt32(cmd.ExecuteScalar()); if (con.State == ConnectionState.Open) { con.Close(); } con.Close(); #region Calling yourguy api // var objtblUser = CommanAction.GetSession();//for yourguyonly using (DBKOMPDataContext db = new DBKOMPDataContext()) { var orders = (from w in db.Orders where w.Id == objPaymentHistory.OrderId select w).First(); var SipBilObj = DBAccess.GetShippingBillingByUserId(orders.CustomerId ?? 0, orders.pincode ?? 0);//for yourguyonly var orderDetails = (from w in db.OrderDetails where w.OrderId == objPaymentHistory.OrderId select w); //string time = orders.IsLunch == 1 ? "12:16:06Z" : "20:16:06Z"; string locationOfPinCode = string.Empty; locationOfPinCode = (from w in db.tblLocations where w.pincode.Value == orders.pincode select w).First().Location; //Yourguy productid var prodcId = "0"; //Your guy DateColletion List <string> lstDeliveryDate = new List <string>(); //Your guy time //string time = orders.IsLunch == 1 ? "12:16:06Z" : "20:16:06Z"; //Your guy time string Deliverytime = orders.IsLunch == 1 ? "2015-01-01T12:16:06Z" : "2015-01-01T20:16:06Z"; string time = orders.IsLunch == 1 ? "12:16:06Z" : "20:16:06Z"; string PickUptime = orders.IsLunch == 1 ? "2015-01-01T10:16:06Z" : "2015-01-01T18:16:06Z"; foreach (var od in orderDetails) { prodcId = "0"; //prodcId = od.SubProductId.ToString(); lstDeliveryDate.Add(od.DeliverDate.Value.ToString("yyyy-MM-ddT") + time); od.IsActive = 1; //od.YourguyOrderId = OrderManagement.CallYourGuy(od.Id.ToString(), objPaymentHistory.OrderId.ToString(), SipBilObj, od.DeliverDate.Value.ToString("yyyy-MM-ddT") + time); //"2015-07-22T12:16:06Z" } //Yourguy service //Yourguy service TODO: UNDO ONCE READY BY YOUR GUY //orders.YourguyOrderId = OrderManagement.CallYourGuy(prodcId, orders.Id.ToString(), SipBilObj, Deliverytime, PickUptime, lstDeliveryDate, locationOfPinCode); db.SubmitChanges(); } #endregion ShippingBilling objSB = DBAccess.GetShippingBilling(rqst); #region Send Mail string content = string.Empty; string filepath = "~/Email/Post.htm"; //New user StringBuilder sbContent = new StringBuilder(); StreamReader rdr = new StreamReader(HttpContext.Current.Server.MapPath(filepath)); string strLine = ""; while (strLine != null) { strLine = rdr.ReadLine(); if ((strLine != null) && (strLine != "")) { sbContent.Append("\n" + strLine); } } rdr.Close(); string site = ConfigurationManager.AppSettings["SiteName"].ToString(); content = sbContent.ToString(); //content = content.Replace("$REQ$", PostType); //content = content.Replace("$ID$", ID); var sbOff = new StringBuilder(); //divOff.RenderControl(new HtmlTextWriter(new StringWriter(sbOff))); content = content.Replace("$ORDERSUMMARY$", "Congratulation!! Your Order #" + objPaymentHistory.OrderId + " is confirmed!<br/>KOMP has received payment of Rs. " + objPaymentHistory.Amount + " /-"); var sb = new StringBuilder(); //divFinal.RenderControl(new HtmlTextWriter(new StringWriter(sb))); content = content.Replace("$REQ$", ""); content = content.Replace("$NAME$", objSB.FirstName); content = content.Replace("$SITE$", site); content = content.Replace("RobotoBlack", "Arial"); content = content.Replace("Roboto", "Arial"); content = content.Replace("RobotoBold", "Arial"); content = content.Replace("images/rs3.png", "http://www.kitchenonmyplate.com/images/rs3.png"); content = content.Replace("class", "style"); content = content.Replace("page-titleSmallCust", "color:#4b220c; text-transform:uppercase; font-family:'Arial'; font-weight:bold;border-bottom:1px solid #c8c6c6; padding:10px 0 10px 25px ; font-size:25px; margin-top:0px;background:#EEEEEE !important;"); content = content.Replace("OrderBox", "display:none"); content = content.Replace("ProcessBox", "width:100%;height:auto;border:1px solid #c8c6c6;padding-bottom:10px;"); content = content.Replace("ProcesBoxInner", "height:auto; padding:0px 25px 10px 10px;text-align: justify; text-justify: inter-word;"); content = content.Replace("tbl", "width:100%;height:auto;border:1px solid #c8c6c6;"); content = content.Replace("divRowHeader", "font-weight:bold; color:Black; font-size:0.85em;"); content = content.Replace("<table", "<table style='border-collapse:collapse; border-spacing:0;' "); content = content.Replace("price", "font-weight:700; font-size:1.2em; color: #006400;"); content = content.Replace("priceTotaltxt", "font-weight:700; font-size:24px; color: #006400;"); content = content.Replace("priceTotal", "font-size:30px; color: #006400; padding-right:25px;"); content = content.Replace("CUSTBOX", ""); content = content.Replace("emailH5", "font-size:14px;"); content = content.Replace(">01<", ""); content = content.Replace(">03<", ""); if (!string.IsNullOrEmpty(objSB.LastName)) //Note : last name is as emailid { MailHelper.SendMailMessage("", objSB.LastName, string.Empty, string.Empty, "KOMP : Your order #" + objPaymentHistory.OrderId + " is confirmed", content); AutoServices.SendeMailToUs("Copy:KOMP : Your order #" + objPaymentHistory.OrderId + " is confirmed", content); } #endregion return(1); } catch (Exception exc) { transaction.Rollback(); return(0); //throw exc; } }
protected void btnAdvance_Click(object sender, EventArgs e) { DateTime serverTime = DateTime.Now; DateTime utcTime = serverTime.ToUniversalTime(); // convert it to Utc using timezone setting of server computer TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); DateTime localTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, tzi); string date = localTime.ToString("ddMMyy"); string dd = (Convert.ToInt32(date.ToString().Substring(0, 2)) * 2).ToString().PadLeft(2, '0'); string mm = (Convert.ToInt32(date.ToString().Substring(2, 2)) * 2).ToString().PadLeft(2, '0'); string yy = (Convert.ToInt32(date.ToString().Substring(4, 2)) * 2).ToString().PadLeft(2, '0'); string paymentLink = "http://www.kitchenonmyplate.com/Default.aspx?OFT=" + dd + mm + yy; #region Send Mail string content = string.Empty; string filepath = "~/Email/Post.htm"; //New user StringBuilder sbContent = new StringBuilder(); StreamReader rdr = new StreamReader(HttpContext.Current.Server.MapPath(filepath)); string strLine = ""; while (strLine != null) { strLine = rdr.ReadLine(); if ((strLine != null) && (strLine != "")) { sbContent.Append("\n" + strLine); } } rdr.Close(); string site = ConfigurationManager.AppSettings["SiteName"].ToString(); content = sbContent.ToString(); //content = content.Replace("$REQ$", PostType); //content = content.Replace("$ID$", ID); var sbOff = new StringBuilder(); //divOff.RenderControl(new HtmlTextWriter(new StringWriter(sbOff))); content = content.Replace("$ORDERSUMMARY$", "Click on below link to place your order!"); var sb = new StringBuilder(); //divFinal.RenderControl(new HtmlTextWriter(new StringWriter(sb))); content = content.Replace("$REQ$", "<a href='" + paymentLink + "' >Order Now</a><br/><br/>Link will work only for today"); content = content.Replace("$NAME$", "Dear Sir/Madam"); content = content.Replace("$SITE$", site); content = content.Replace("RobotoBlack", "Arial"); content = content.Replace("Roboto", "Arial"); content = content.Replace("RobotoBold", "Arial"); content = content.Replace("images/rs3.png", "http://www.kitchenonmyplate.com/images/rs3.png"); content = content.Replace("class", "style"); content = content.Replace("page-titleSmallCust", "color:#4b220c; text-transform:uppercase; font-family:'Arial'; font-weight:bold;border-bottom:1px solid #c8c6c6; padding:10px 0 10px 25px ; font-size:25px; margin-top:0px;background:#EEEEEE !important;"); content = content.Replace("OrderBox", "display:none"); content = content.Replace("ProcessBox", "width:100%;height:auto;border:1px solid #c8c6c6;padding-bottom:10px;"); content = content.Replace("ProcesBoxInner", "height:auto; padding:0px 25px 10px 10px;text-align: justify; text-justify: inter-word;"); content = content.Replace("tbl", "width:100%;height:auto;border:1px solid #c8c6c6;"); content = content.Replace("divRowHeader", "font-weight:bold; color:Black; font-size:0.85em;"); content = content.Replace("<table", "<table style='border-collapse:collapse; border-spacing:0;' "); content = content.Replace("price", "font-weight:700; font-size:1.2em; color: #006400;"); content = content.Replace("priceTotaltxt", "font-weight:700; font-size:24px; color: #006400;"); content = content.Replace("priceTotal", "font-size:30px; color: #006400; padding-right:25px;"); content = content.Replace("CUSTBOX", ""); content = content.Replace("emailH5", "font-size:14px;"); content = content.Replace("<i style='fa fa-inr'></i>", "Rs. "); content = content.Replace(">01<", ""); content = content.Replace(">03<", ""); if (!string.IsNullOrEmpty(txtEmailAdv.Value)) //Note : last name is as emailid { MailHelper.SendMailMessage("", txtEmailAdv.Value, string.Empty, string.Empty, "KOMP : Confirm your order", content); AutoServices.SendeMailToUs("Copy:KOMP : KOMP : Confirm your order", content); } txtEmailAdv.Value = ""; #endregion }
protected void Page_Load(object sender, EventArgs e) { PaymentResponse objPaymentResponse = new PaymentResponse(); if (Session["PaymentResponse"] != null) { objPaymentResponse = (PaymentResponse)Session["PaymentResponse"]; Session.Remove("PaymentResponse"); } else if (Request.QueryString["method"] == "11" || Request.QueryString["method"] == "12" || Request.QueryString["method"] == "13" || Request.QueryString["method"] == "14")//Offline { objPaymentResponse.PaymentMethod = Request.QueryString["method"]; objPaymentResponse.PaymentDone = "0"; objPaymentResponse.RequestId = Request.QueryString["requestId"]; } OfflineOnly(objPaymentResponse); if (objPaymentResponse.PaymentDone == "1" || (objPaymentResponse.PaymentDone == "0" && objPaymentResponse.PaymentMethod == "11" || objPaymentResponse.PaymentMethod == "12" || objPaymentResponse.PaymentMethod == "13" || objPaymentResponse.PaymentMethod == "14")) { //var orderDTO = (OrderList)HttpContext.Current.Session["OrderList"]; var requesedItems = DBAccess.GetRequestedItems(Convert.ToInt32(objPaymentResponse.RequestId)); //gridProduct.DataBind(); //lblOrderCode.Text = Request.QueryString["orderId"]; lblPMethod.Text = GetPaymentMethod(objPaymentResponse.PaymentMethod); if (objPaymentResponse.PaymentMethod == "11" || objPaymentResponse.PaymentMethod == "12" || objPaymentResponse.PaymentMethod == "13" || objPaymentResponse.PaymentMethod == "14") //Offline message { lblPaymentMessage.Text = " Thank you for placing your order with Kitchen On My Plate. Here are your Order details"; offlineBankDtl.Visible = true; } //lblTotal.Text = orderDTO.payment.Amount.ToString(); //New // SavePayment(Convert.ToInt32(Request.QueryString["requestId"])); Decimal subTotal = 0; Decimal tranChrg = 0; Decimal deliveryChrg = 0; string colspan = "0"; string startdate = string.Empty; string productName = "Customized Meals"; string Quantity = string.Empty; string mealstartdate = string.Empty; string LunchDinner = string.Empty; string OrderNumbers = string.Empty; foreach (var item in requesedItems) { productName = "Customized Meals"; OrderNumbers = (string.IsNullOrEmpty(OrderNumbers))? item.orderId.ToString():(OrderNumbers + "," + item.orderId.ToString()); LunchDinner = item.IsTiffin == 1 ? "Lunch" : "Dinner"; if (item.nonCustomized == 0) { tbOrders.Text = tbOrders.Text + "<tr class='divRow dataHeader'><td><b>MEAL NAME</b></td><td><b>PRICE</b></td><td><b>QUANTITY</b></td><td><b>TOTAL</b></td></tr>"; colspan = "3"; } else { tbOrders.Text = tbOrders.Text + "<tr class='divRow dataHeader'><td><b>MEAL DETAILS</b></td><td><b>AMOUNT DETAILS</b></td></tr>"; colspan = "0"; } int indx = 0; foreach (var odr in item.orderedItems) { indx++; if (indx == 1) { startdate = odr.DeliverDate.ToString(); mealstartdate = odr.DeliverDate.ToString(); } if (item.nonCustomized == 0) { //Customized tbOrders.Text = tbOrders.Text + "<tr class='divRow divRowData'><td>" + odr.ProductName + ".</td><td>" + odr.Price + "</td><td>1</td><td>" + odr.Price + "</td></tr>"; } else { //Tiffin if (indx == 1) { tbOrders.Text = tbOrders.Text + "<tr class='divRow'><td style='width:70%;' id='divPNAME'> <span class='price'>" + odr.ProductName + "</span></td><td style='width:30%;' align='center'><strong>" + item.orderedItems.Count * Convert.ToDecimal(odr.Price) + "</strong></td></tr>"; productName = odr.ProductName; } } } Quantity = item.orderedItems.Count.ToString(); subTotal = subTotal + item.subTotal; deliveryChrg = deliveryChrg + item.deliveryCharges; tranChrg = tranChrg + item.transCharges; //It is with top details tbOrders1.Text = tbOrders1.Text + "<tr class='divRow cstItem' id='Ord11" + item.orderId.ToString() + "' align='center'></td><td align='center' style=''>" + item.orderId.ToString() + "</td><td style='width:40%;' align='center'> <span>" + productName + "</span></td><td align='center'><span>" + item.orderedItems.Count + "</span></td><td style='' align='center'><span class=''>" + Convert.ToDateTime(mealstartdate).ToString("dd/MM/yy") + "</span></td><td style='' align='center'><span id='' class=''>" + LunchDinner + "</span></td></tr>"; // tbOrders.Text = tbOrders.Text + "<tr class='divRow' align='right'><td colspan='" + colspan + "'><b>Sub Total </b> </td><td align='center'><b>" + item.subTotal + "</b></td></tr>"; // tbOrders.Text = tbOrders.Text + "<tr class='divRow' align='right'><td colspan='" + colspan + "'><b>Delivery Charges </b> </td><td align='center'><b>" + item.deliveryCharges + "</b></td></tr>"; if (item.transCharges > 0) { //if (objPaymentResponse.PaymentMethod == "14") //Cash pickup option of off line //{ // tbOrders.Text = tbOrders.Text + "<tr class='divRow' align='right'><td colspan='" + colspan + "'><b>Cash Pick up Charges </b> </td><td align='center'><b>" + item.transCharges + "</b></td></tr>"; //} //else //{ // tbOrders.Text = tbOrders.Text + "<tr class='divRow' align='right'><td colspan='" + colspan + "'><b>Online Processing Charges </b> </td><td align='center'><b>" + item.transCharges + "</b></td></tr>"; //} } //tbOrders.Text = tbOrders.Text + "<tr class='divRow' align='right' ><td colspan='" + colspan + "'><span style='font-family:RobotoBlack' >Amount </span> </td><td align='center' ><span style='font-family:RobotoBlack' >" + item.grandTotal + "</span></td></tr>"; tbOrders.Text = tbOrders.Text + "<tr class='divRow' align='right' ><td colspan='" + colspan + "'><span style='font-family:RobotoBlack' >Amount </span> </td><td align='center' ><i class='fa fa-inr'></i><span style='font-family:RobotoBlack' >" + item.subTotal + "</span></td></tr>"; spnRqst.InnerText = spnRqst.InnerText == "" ? item.orderId.ToString() : (spnRqst.InnerText + ", " + item.orderId.ToString()); } spnSubTotal.InnerHtml = "<i class='fa fa-inr'></i>" + subTotal.ToString(); spnDelivery.InnerHtml = "<i class='fa fa-inr'></i>" + deliveryChrg.ToString(); trTran.Visible = tranChrg > 0; //string transactionStr = ""; string transactionStr = tranChrg.ToString(); if (objPaymentResponse.PaymentMethod == "14") //Cash pickup option of off line { strOnln.InnerHtml = "Cash Pick up Charges "; //Cash check pickup //var config = DBAccess.GetConfig(); //tranChrg = Convert.ToInt32(tranChrg + config.CashPickUp ?? 0); tranChrg = Convert.ToInt32(tranChrg); transactionStr = tranChrg + ".00";; } spnTrns.InnerHtml = "<i class='fa fa-inr'></i>" + transactionStr.ToString(); spnOnlineGrandTotal.InnerHtml = "<i class='fa fa-inr'></i>" + (subTotal + deliveryChrg + tranChrg).ToString(); if (!(objPaymentResponse.PaymentMethod == "11" || objPaymentResponse.PaymentMethod == "12" || objPaymentResponse.PaymentMethod == "13" || objPaymentResponse.PaymentMethod == "14")) //online message { lblPaymentMessage.Text = "Thank you for placing your order with Kitchen On My Plate. We have received the payment for the amount " + spnOnlineGrandTotal.InnerText + " on " + DateTime.Today.ToString("dd/MM/yy") + " for the Order No. " + OrderNumbers + ". Here are your Order details"; } var shippingBilling = DBAccess.GetShippingBilling(Convert.ToInt32(objPaymentResponse.RequestId)); string strlocation = DBAccess.CheckDeliveryArea(Convert.ToInt32(shippingBilling.Pincode)).Location; strongBilling.InnerText = shippingBilling.Address.Replace("$", ", ") + ", " + strlocation; strlocation = DBAccess.CheckDeliveryArea(Convert.ToInt32(shippingBilling.PincodeB)).Location; strongDelivery.InnerText = shippingBilling.AddressB.Replace("$", ", ") + ", " + strlocation; if (CommanAction.GetSession() != null) { var objtblUser = CommanAction.GetSession(); //Order Summary start //if (Request.QueryString["method"] == "5") //{ divOff.Visible = true; spnName.InnerText = objtblUser.FirstName; //spnRqst.InnerText = objPaymentResponse.RequestId;// Request.QueryString["requestId"]; spnSA.InnerText = shippingBilling.Address.Replace("$", ", ") + shippingBilling.LandMark + " " + shippingBilling.Pincode;//+shippingBilling.City; spnBA.InnerText = shippingBilling.Address.Replace("$", ", ") + shippingBilling.LandMark + " " + shippingBilling.Pincode; spnRQSTDATE.InnerText = DateTime.Today.ToString("dd/MM/yy"); spnPName.InnerText = productName; spnQuantity.InnerText = Quantity; spnMealPP.InnerText = Quantity + " days"; spnPaymentMode.InnerText = GetPaymentMethod(objPaymentResponse.PaymentMethod); decimal ds = spnPaymentAmount.InnerHtml == "" ? 0 : Convert.ToDecimal(spnPaymentAmount.InnerHtml); spnPaymentAmount.InnerHtml = (ds + subTotal + deliveryChrg + tranChrg).ToString();; spnPaymentStatus.InnerText = GetStatusById(objPaymentResponse.PaymentDone); spnaMealSDate.InnerText = Convert.ToDateTime(mealstartdate).ToString("dd/MM/yy"); spnaMealType.InnerText = LunchDinner; //} //Order Summary end #region Send Mail string content = string.Empty; string filepath = "~/Email/Post.htm"; //New user StringBuilder sbContent = new StringBuilder(); StreamReader rdr = new StreamReader(HttpContext.Current.Server.MapPath(filepath)); string strLine = ""; while (strLine != null) { strLine = rdr.ReadLine(); if ((strLine != null) && (strLine != "")) { sbContent.Append("\n" + strLine); } } rdr.Close(); string site = ConfigurationManager.AppSettings["SiteName"].ToString(); content = sbContent.ToString(); //content = content.Replace("$REQ$", PostType); //content = content.Replace("$ID$", ID); var sbOff = new StringBuilder(); divOff.RenderControl(new HtmlTextWriter(new StringWriter(sbOff))); //sbOff.Replace("hideonemail", "display:none"); content = content.Replace("$ORDERSUMMARY$", sbOff.ToString()); //All Orders Start var sbOff1 = "<br/><br/><table class='tableCart tbl' cellspacing='1' width='100%' align='center' cellpadding='5' ><thead>" + "<tr class='divRow dataHeader' style='background:#F16822;color:#fff;font-family:RobotoBold;font-size:1em; ' ><td>ORDER#</td><td>PRODUCT</td><td>QUANTITY</td><td>START DATE</td><td>MEAL TYPE</td></tr>" + "</thead><tbody>" + tbOrders1.Text + "</tbody></table>"; content = content.Replace("$ALLORDERS$", sbOff1); //All Orders End var sb = new StringBuilder(); divFinal.RenderControl(new HtmlTextWriter(new StringWriter(sb))); content = content.Replace("$REQ$", sb.ToString()); content = content.Replace("$NAME$", objtblUser.FirstName + " " + objtblUser.LastName); content = content.Replace("$SITE$", site); content = content.Replace("RobotoBlack", "Arial"); content = content.Replace("RobotoBold", "Arial"); content = content.Replace("Roboto", "Arial"); content = content.Replace("images/rs3.png", "http://www.kitchenonmyplate.com/images/rs3.png"); content = content.Replace("hideonemail", "display:none;max-height: 0px; font-size: 0px; overflow: hidden; mso-hide: all"); content = content.Replace("<strong>", "<span>"); content = content.Replace("</strong>", "</span>"); content = content.Replace("h1>", "h2>"); content = content.Replace("<h1", "<h2"); content = content.Replace("<i class='fa fa-inr'></i>", "Rs. "); //content = content.Replace("class", "style"); //content = content.Replace("page-titleSmallCust", "color:#4b220c; text-transform:uppercase; font-family:'Arial'; font-weight:bold;border-bottom:1px solid #c8c6c6; padding:10px 0 10px 25px ; font-size:25px; margin-top:0px;background:#EEEEEE !important;"); //content = content.Replace("OrderBox", "display:none"); //content = content.Replace("ProcesBoxInner", "height:auto; padding:0px 25px 10px 10px;text-align: justify; text-justify: inter-word;"); //content = content.Replace("ProcessBox", "width:100%;height:auto;border:1px solid #c8c6c6;padding-bottom:10px;"); //content = content.Replace("tbl", "width:100%;height:auto;border:1px solid #c8c6c6;"); //content = content.Replace("divRowHeader", "font-weight:bold; color:Black; font-size:0.85em;"); //content = content.Replace("<table", "<table style='border-collapse:collapse; border-spacing:0;' border='1' "); //content = content.Replace("priceTotaltxt", "font-weight:700; font-size:24px; color: #006400;"); //content = content.Replace("priceTotal", "font-size:30px; color: #006400; padding-right:25px;"); //content = content.Replace("price", "font-weight:700; font-size:1.2em; color: #006400;"); //content = content.Replace("CUSTBOX", ""); //content = content.Replace("emailH5", "font-size:14px;color:#f37624;font-family:Arial;"); content = content.Replace(">01<", "><"); content = content.Replace(">03<", "><"); if (!string.IsNullOrEmpty(objtblUser.email)) { MailHelper.SendMailMessage("", objtblUser.email, string.Empty, string.Empty, "Thanks For Placing Order", content); AutoServices.SendeMailToUs("Copy:Thanks For Placing Order", content); } trlist.Visible = true; #endregion } //Deleting cookies //if (Request.Cookies["ORDERLIST"] != null) //{ // HttpCookie myCookie = new HttpCookie("ORDERLIST"); // myCookie.Expires = DateTime.Now.AddDays(-1d); // Response.Cookies.Add(myCookie); //} } Session.Remove("OrderList"); //Deleting cookies if (Request.Cookies["ORDERLIST"] != null) { HttpCookie myCookie = new HttpCookie("ORDERLIST"); myCookie.Expires = DateTime.Now.AddDays(-1d); Response.Cookies.Add(myCookie); } }