Exemplo n.º 1
0
        public static bool SaveFuelDetails(FuelPriceListModel model)
        {
            using (var conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
            {
                using (var cmd = new SqlCommand("sp_InsertFuelDetails", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("station_id", model.PumpID);
                    cmd.Parameters.AddWithValue("fuel_type_id", model.FuelID);
                    cmd.Parameters.AddWithValue("price", model.Price);
                    cmd.Parameters.AddWithValue("updated_by", model.UpdatedBy);

                    conn.Open();
                    try
                    {
                        cmd.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        throw;
                    }


                    conn.Close();
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        public ActionResult SaveFuelDetails(FuelPriceListModel model)
        {
            var user = ((UserValidation.CustomPrincipal)(HttpContext.Request.RequestContext.HttpContext.User)).User;

            model.UpdatedBy = user.LoginEmpID;
            var data = BusinessAccessLayer.BALFuel.BALSaveFuelDetails(model);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
 public static bool BALSaveFuelDetails(FuelPriceListModel model)
 {
     return(DataRepository.FuelRepository.SaveFuelDetails(model));
 }