Beispiel #1
0
        public static FuelChashModel GetCashFuelSalesDetails(CashFuleSale model)
        {
            FuelChashModel objcash = new FuelChashModel();

            using (var conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
            {
                using (var cmd = new SqlCommand("sp_GetCashFuelSale", conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("pumpid", model.PumpId);
                    cmd.Parameters.AddWithValue("fueltypeid", model.FuelType);
                    cmd.Parameters.AddWithValue("patrolQuantity", model.ChitQuanity);
                    cmd.Parameters.AddWithValue("staffqaunity", model.StaffQuanity);
                    cmd.Parameters.AddWithValue("otherquantity", model.OtherQuanity);
                    cmd.Parameters.AddWithValue("startreading", model.StartReading);
                    cmd.Parameters.AddWithValue("endreading", model.EndReading);

                    conn.Open();
                    SqlDataReader rd = cmd.ExecuteReader();

                    while (rd.Read())
                    {
                        objcash = new FuelChashModel
                        {
                            Quantity = (Convert.ToDecimal(rd["CashQuantity"])),

                            Price = Convert.ToDecimal(rd["TotalPrice"])
                        };
                    }
                }
            }
            return(objcash);
        }
Beispiel #2
0
        public ActionResult GetCashDetails(CashFuleSale model)
        {
            var data = BusinessAccessLayer.BALFuel.BALGetCashFuelSalesDetails(model);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
 public static FuelChashModel BALGetCashFuelSalesDetails(CashFuleSale model)
 {
     return(FuelRepository.GetCashFuelSalesDetails(model));
 }