public ActionResult Sale(ProductSaleAdd request)
        {
            string name         = HttpContext.User.Identity.Name;
            string operatorName = AgroExpressDBAccess.GetFullNamebyUserID(name);

            bool smsStatus = false;

            if (ModelState.IsValid)
            {
                List <Sale> SaleRequest = new List <Sale>();

                double TotalBill = 0;
                double TottalPai = 0;
                foreach (var sale in request.ProductSaleInfo)
                {
                    if (sale.ProductId != null && sale.ProductId != 0 && sale.Amount != null && sale.Amount != 0 && sale.Rate != null && sale.Servicecharge != null)
                    {
                        SaleRequest.Add(new Sale
                        {
                            ProductId     = (int)sale.ProductId,
                            Amount        = (double)sale.Amount,
                            Rate          = (double)sale.Rate,
                            ServiceCharge = (double)sale.Servicecharge,
                            CustomerId    = request.CustomerID,
                            OperatorName  = operatorName,
                            DateTime      = request.SaleDate,
                            SMSSent       = smsStatus
                        });
                        TotalBill += (double)sale.Amount * ((double)sale.Rate + (double)sale.Servicecharge);
                    }
                }
                if (request.BillPaid != null)
                {
                    TottalPai = (double)request.BillPaid;
                }
                AgroExpressDBAccess.AddProductSaleList(SaleRequest, request.CustomerID, request.SalePointId, TotalBill, TottalPai, operatorName);
            }
            ModelState.Clear();
            ProductSaleAdd ProductSaleView = ProductSaleInitial();

            return(View(ProductSaleView));
        }