public ActionResult DeleteConfirmed(int id) { tblSource tblSource = db.tblSource.Find(id); db.tblSource.Remove(tblSource); db.SaveChanges(); return(RedirectToAction("Index")); }
public int AddSourceAddress(SourceAddressEntities se) { var config = new MapperConfiguration(cfg => cfg.CreateMap <SourceAddressEntities, tblSource>()); IMapper mapper = config.CreateMapper(); tblSource sa = mapper.Map <SourceAddressEntities, tblSource>(se); int SourceId = bookingRepository.AddSourceAddress(sa); return(SourceId); }
public ActionResult Edit([Bind(Include = "ID,Source,Color")] tblSource tblSource) { if (ModelState.IsValid) { db.Entry(tblSource).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblSource)); }
public ActionResult Create([Bind(Include = "ID,Source,Color")] tblSource tblSource) { if (ModelState.IsValid) { db.tblSource.Add(tblSource); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblSource)); }
protected void Button2_Click(object sender, EventArgs e) { using (var obj = new QueryDataContext()) { var source = new tblSource(); source.FK_TypeId = Convert.ToInt64(ddlTypes.SelectedValue); source.Latitude = Convert.ToDecimal(HiddenField2.Value); source.LocationName = HiddenField1.Value; source.Lontitude = Convert.ToDecimal(HiddenField3.Value); obj.tblSources.InsertOnSubmit(source); obj.SubmitChanges(); } }
// GET: Sources/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblSource tblSource = db.tblSource.Find(id); if (tblSource == null) { return(HttpNotFound()); } return(View(tblSource)); }
public int AddSourceAddress(tblSource objSAddress) { db.tblSources.Add(objSAddress); db.SaveChanges(); return(objSAddress.ID); }
private void detach_tblSources(tblSource entity) { this.SendPropertyChanging(); entity.tblType = null; }
private void attach_tblSources(tblSource entity) { this.SendPropertyChanging(); entity.tblType = this; }
partial void DeletetblSource(tblSource instance);
partial void UpdatetblSource(tblSource instance);
partial void InserttblSource(tblSource instance);