Ejemplo n.º 1
0
        public ProductOrderCommon GadgetData(string ProductReferenceId, string User)
        {
            var data = new ProductOrderCommon();
            var sql  = "Exec proc_PlaceOrder ";

            sql += " @flag= " + dao.FilterString("GadgetInfo");
            sql += " ,@ProductReferenceId =" + dao.FilterString(ProductReferenceId);
            sql += " ,@User ="******"ProductReferenceId"].ToString();
                    data.ProductDistinctId  = item["ProductDistinctId"].ToString();
                    data.ProductQuantity    = item["ProductQuantity"].ToString();
                    data.ProductName        = item["ProductName"].ToString();
                    data.ProductPrice       = item["ProductPrice"].ToString();

                    data.SupplierEmail     = item["SupplierEmail"].ToString();
                    data.SupplierName      = item["SupplierName"].ToString();
                    data.SupplierContactNo = item["SupplierContactNo"].ToString();
                    data.SupplierAddress   = item["SupplierAddress"].ToString();
                    data.SupplierLatitude  = item["SupplierLatitude"].ToString();
                    data.SupplierLongitude = item["SupplierLongitude"].ToString();
                    data.DocName           = item["DocName"].ToString();
                }
            }

            return(data);
        }
        public ActionResult Clothes(ProductOrderCommon Common)
        {
            Common.User        = StaticData.GetUser();
            Common.ProductLink = "/ProductDetail/ClothesDetail?ProductReferenceId=" + Common.ProductReferenceId;
            var response = buss.Manage(Common);

            if (response.ErrorCode != 0)
            {
                DbResponse resp = new DbResponse();
                resp.ErrorCode = response.ErrorCode;
                resp.Message   = response.Message;
                StaticData.SetMessageInSession(resp);
                return(View(Common));
            }
            var mailBody      = "Dear Sir,<br/> Your Order is successfully placed . Thanks for ordering " + Common.ProductName + ", " + Common.ProductQuantity + " item. You will be get shipped your product soon.<br/> Thank you!";
            var emailResponse = SendEmail(StaticData.GetUser(), "Order Placement", mailBody);

            if (emailResponse == false)
            {
                DbResponse resp = new DbResponse();
                resp.ErrorCode = 1;
                resp.Message   = "You email no doesnot found";
                StaticData.SetMessageInSession(resp);
            }


            var rootUrl = System.Configuration.ConfigurationManager.AppSettings["urlRoot"];

            mailBody      = "Dear Supplier,<br/> Our Customer Mr./Mrs. " + Common.CustomerFullName + " has place the order for " + rootUrl + Common.ProductLink + "." + Common.ProductName + ", " + Common.ProductQuantity + "item , " + Common.ProductSize + ", " + Common.ProductColor + "  is requested to supply immediately to the" + StaticData.GetUser() + ". <br/>Thank you!";
            emailResponse = SendEmail(Common.SupplierEmail, "Order Placement", mailBody);

            if (emailResponse == false)
            {
                DbResponse resp = new DbResponse();
                resp.ErrorCode = 1;
                resp.Message   = "You email no doesnot found";
                StaticData.SetMessageInSession(resp);
            }
            var orderid = response.Id;

            return(RedirectToAction("MakePayment", new { OrderId = orderid, TotalPrice = Common.TotalPrice }));

            //return RedirectToAction("Index", "Home");
        }
Ejemplo n.º 3
0
        public DbResponse Manage(ProductOrderCommon common)
        {
            var sql = "Exec proc_PlaceOrder   @flag= 'I' ";

            sql += ", @ProductReferenceId=" + dao.FilterString(common.ProductReferenceId == null ? "" : common.ProductReferenceId);
            sql += ", @ProductDistinctId=" + dao.FilterString(common.ProductDistinctId == null ? "" : common.ProductDistinctId);
            //sql += ", @CartId=" + dao.FilterString(common.CartId == null ? "" : common.CartId);
            sql += ", @ProductName=" + dao.FilterString(common.ProductName == null ? "" : common.ProductName);
            //sql += ", @ProductStatus=" + dao.FilterString(common.ProductStatus == null ? "" : common.ProductStatus);
            sql += ", @ProductQuantity=" + dao.FilterString(common.ProductQuantity == null ? "" : common.ProductQuantity);
            sql += ", @ProductSize=" + dao.FilterString(common.ProductSize == null ? "" : common.ProductSize);
            sql += ", @ProductColor=" + dao.FilterString(common.ProductColor == null ? "" : common.ProductColor);
            sql += ", @ProductPrice=" + dao.FilterString(common.ProductPrice == null ? "" : common.ProductPrice);
            //sql += ", @ProductCartStatus=" + dao.FilterString(common.ProductCartStatus == null ? "" : common.ProductCartStatus);

            sql += ", @ProductLink=" + dao.FilterString(common.ProductLink == null ? "" : common.ProductLink);
            sql += ", @CustomerContactNo=" + dao.FilterString(common.CustomerContactNo == null ? "" : common.CustomerContactNo);
            sql += ", @CustomerFullName=" + dao.FilterString(common.CustomerFullName == null ? "" : common.CustomerFullName);
            sql += ", @DeliveryAddress=" + dao.FilterString(common.DeliveryAddress == null ? "" : common.DeliveryAddress);
            sql += ", @DeliveryLatitude=" + dao.FilterString(common.DeliveryLatitude == null ? "" : common.DeliveryLatitude);
            sql += ", @DeliveryLongitude=" + dao.FilterString(common.DeliveryLongitude == null ? "" : common.DeliveryLongitude);
            sql += ", @SupplierName=" + dao.FilterString(common.SupplierName == null ? "" : common.SupplierName);
            sql += ", @SupplierAddress=" + dao.FilterString(common.SupplierAddress == null ? "" : common.SupplierAddress);
            sql += ", @SupplierContactNo=" + dao.FilterString(common.SupplierContactNo == null ? "" : common.SupplierContactNo);
            sql += ", @SupplierLatitude=" + dao.FilterString(common.SupplierLatitude == null ? "" : common.SupplierLatitude);
            sql += ", @SupplierLongitude=" + dao.FilterString(common.SupplierLongitude == null ? "" : common.SupplierLongitude);
            sql += ", @SupplierEmail=" + dao.FilterString(common.SupplierEmail == null ? "" : common.SupplierEmail);

            sql += ", @ShippingDistance=" + dao.FilterString(common.ShippingDistance == null ? "" : common.ShippingDistance);
            sql += ", @ShippingCharge=" + dao.FilterString(common.ShippingCharge == null ? "" : common.ShippingCharge);
            sql += ", @TotalPrice=" + dao.FilterString(common.TotalPrice == null ? "" : common.TotalPrice);
            sql += ", @User="******"" : common.User);



            var response = dao.ParseDbResponse(sql);

            return(response);
        }
 public DbResponse Manage(ProductOrderCommon common)
 {
     return(repo.Manage(common));
 }