public virtual void Save(MapTaxLots maptaxlots) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings[@"KID"].ConnectionString)) { using (SqlCommand command = new SqlCommand()) { command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "sp_Map_InsertUpdate"; if (maptaxlots.MapTaxLot != null) { command.Parameters.AddWithValue("@MapTaxLot", maptaxlots.MapTaxLot); } command.Parameters.AddWithValue("@DivisionID", maptaxlots.DivisionID); command.Parameters.AddWithValue("@TrackingID", maptaxlots.TrackingID); command.Parameters.AddWithValue("@Structure", maptaxlots.Structure); command.Parameters.AddWithValue("@LongName", maptaxlots.LongName); command.Parameters.AddWithValue("@Ride", maptaxlots.Ride); command.Parameters.AddWithValue("@Status", maptaxlots.Status); command.Parameters.AddWithValue("@Acers", maptaxlots.Acers); command.Parameters.AddWithValue("@Rate", maptaxlots.Rate); command.Parameters.AddWithValue("@Allotment", maptaxlots.Allotment); command.Parameters.AddWithValue("@Name", maptaxlots.Name); connection.Open(); command.ExecuteNonQuery(); } } }
public virtual MapTaxLots Get(string MapTaxLot) { MapTaxLots s = null; using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings[@"KID"].ConnectionString)) { using (SqlCommand command = new SqlCommand()) { command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "sp_Map_Get"; command.Parameters.AddWithValue("@MapTaxLot", MapTaxLot); connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { if (reader.Read()) { s = new MapTaxLots(); s.MapTaxLot = reader["MapTaxLot"].ToString(); s.DivisionID = reader["DivisionID"].ToString(); s.TrackingID = int.Parse(reader["TrackingID"].ToString()); s.Structure = reader["Structure"].ToString(); s.LongName = reader["LongName"].ToString(); s.Ride = int.Parse(reader["Ride"].ToString()); s.Status = reader["Statust"].ToString(); s.Acers = decimal.Parse(reader["Acers"].ToString()); s.Rate = decimal.Parse(reader["Rate"].ToString()); s.Allotment = decimal.Parse(reader["Allotment"].ToString()); s.Name = reader["Name"].ToString(); } } } } return(s); }
public ActionResult Add(MapTaxLots maptaxlots) { if (!ModelState.IsValid) { return View(maptaxlots); } _mapRepo.Save(maptaxlots); return RedirectToAction("Index"); }
public ActionResult Index(int? page) { int pageSize = 15; int pageIndex = 1; pageIndex = page.HasValue ? Convert.ToInt32(page) : 1; IPagedList<MapTaxLots> map = null; MapTaxLotRepository maprepository = new MapTaxLotRepository(); MapTaxLots maptaxlots = new MapTaxLots(); List<MapTaxLots> obMapList = new List<MapTaxLots>(); obMapList = maprepository.ViewTaxLot(); maptaxlots.maptaxlots = obMapList; map = obMapList.ToPagedList(pageIndex, pageSize); return View(map); }
public ActionResult Edit(MapTaxLots maptaxlots) { string MapTaxLot = maptaxlots.MapTaxLot; string DivisionID = maptaxlots.DivisionID; int TrackingID = maptaxlots.TrackingID; string Structure = maptaxlots.Structure; string LongName = maptaxlots.LongName; int Ride = maptaxlots.Ride; string Status = maptaxlots.Status; decimal Acers = maptaxlots.Acers; decimal Rate = maptaxlots.Rate; string Name = maptaxlots.Name; decimal Allotment = maptaxlots.Allotment; _mapRepo.Save(maptaxlots); return RedirectToAction("Index"); }
//Save MapTaxLots edit devison and rate status public virtual void SaveDivisionRate(MapTaxLots maptaxlots) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings[@"KID"].ConnectionString)) { using (SqlCommand command = new SqlCommand()) { command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "sp_Map_Rate_Update"; command.Parameters.AddWithValue("@DivisionID", maptaxlots.DivisionID); command.Parameters.AddWithValue("@Status", maptaxlots.Status); command.Parameters.AddWithValue("@Rate", maptaxlots.Rate); connection.Open(); command.ExecuteNonQuery(); } } }
public ActionResult ViewTaxLot(string MapTaxLot) { MapTaxLots maptaxlot = _mapRepo.Get(MapTaxLot); MapTaxLots MapModel = new MapTaxLots() { MapTaxLot = maptaxlot.MapTaxLot, DivisionID = maptaxlot.DivisionID, TrackingID = maptaxlot.TrackingID, Structure = maptaxlot.Structure, LongName = maptaxlot.LongName, Ride = maptaxlot.Ride, Status = maptaxlot.Status, Acers = maptaxlot.Acers, Rate = maptaxlot.Rate, Name = maptaxlot.Name, Allotment = maptaxlot.Allotment }; return ViewTaxLot(MapTaxLot); }
//return the TrackingID from MapTaxLots public virtual MapTaxLots Get_TrackingID(int TrackingId) { MapTaxLots ID = null; using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings[@"KID"].ConnectionString)) { using (SqlCommand command = new SqlCommand()) { command.Connection = connection; command.CommandText = "SELECT TrackingID FROM MapTaxLot"; connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { if (reader.Read()) { ID = new MapTaxLots(); ID.TrackingID = int.Parse(reader["TrackingID"].ToString()); } } } } return(ID); }
public virtual List <MapTaxLots> ViewTaxLot() { List <MapTaxLots> TaxLotList = new List <MapTaxLots>(); using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["KID"].ConnectionString)) { using (SqlCommand command = new SqlCommand()) { command.Connection = connection; command.CommandText = "SELECT * FROM MapTaxLot ORDER BY Name ASC"; command.CommandType = CommandType.Text; connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { MapTaxLots r = new MapTaxLots(); r.MapTaxLot = reader["MapTaxLot"].ToString(); r.DivisionID = reader["DivisionID"].ToString(); r.TrackingID = int.Parse(reader["TrackingID"].ToString()); r.Structure = reader["Structure"].ToString(); r.LongName = reader["LongName"].ToString(); //won't work some odd reason don't show in depoloyment //r.Ride = int.Parse(reader["Ride"].ToString()); r.Status = reader["Status"].ToString(); r.Acers = decimal.Parse(reader["Acers"].ToString()); r.Rate = decimal.Parse(reader["Rate"].ToString()); r.Allotment = decimal.Parse(reader["Allotment"].ToString()); r.Name = reader["Name"].ToString(); TaxLotList.Add(r); } } } } return(TaxLotList); }