public void Setsysdiagrams(sysdiagrams sysdiagramsUp) { MaderaEntities MaderaEntities = new MaderaEntities(); MaderaEntities.sysdiagrams.Add(sysdiagramsUp); MaderaEntities.SaveChanges(); }
public ActionResult DeleteConfirmed(int id) { sysdiagrams sysdiagrams = db.sysdiagrams.Find(id); db.sysdiagrams.Remove(sysdiagrams); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// Create a new sysdiagrams object. /// </summary> /// <param name="name">Initial value of name.</param> /// <param name="principal_id">Initial value of principal_id.</param> /// <param name="diagram_id">Initial value of diagram_id.</param> public static sysdiagrams Createsysdiagrams(string name, int principal_id, int diagram_id) { sysdiagrams sysdiagrams = new sysdiagrams(); sysdiagrams.name = name; sysdiagrams.principal_id = principal_id; sysdiagrams.diagram_id = diagram_id; return(sysdiagrams); }
public ActionResult Edit([Bind(Include = "name,principal_id,diagram_id,version,definition")] sysdiagrams sysdiagrams) { if (ModelState.IsValid) { db.Entry(sysdiagrams).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sysdiagrams)); }
public ActionResult Create([Bind(Include = "name,principal_id,diagram_id,version,definition")] sysdiagrams sysdiagrams) { if (ModelState.IsValid) { db.sysdiagrams.Add(sysdiagrams); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sysdiagrams)); }
public ActionResult Update(sysdiagrams sysdiagrams) { if (sysdiagramsService.Update(sysdiagrams)) { return(Redirect("sysdiagrams")); } else { return(Content("no")); } }
public void InsertSysdiagrams(sysdiagrams sysdiagrams) { if ((sysdiagrams.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagrams, EntityState.Added); } else { this.ObjectContext.sysdiagrams.AddObject(sysdiagrams); } }
/// <summary> /// dohvati jedan po primary key-u /// </summary> /// <param name="guid"></param> /// <returns></returns> public sysdiagrams Get(int Id) { sysdiagrams item = null; using (Entities data = new Entities()) { item = data.sysdiagrams.Where(r => r.Id == Id).FirstOrDefault(); } return(item); }
// POST: odata/sysdiagrams public IHttpActionResult Post(sysdiagrams sysdiagrams) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.sysdiagrams.Add(sysdiagrams); db.SaveChanges(); return(Created(sysdiagrams)); }
public void DeleteSysdiagrams(sysdiagrams sysdiagrams) { if ((sysdiagrams.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagrams, EntityState.Deleted); } else { this.ObjectContext.sysdiagrams.Attach(sysdiagrams); this.ObjectContext.sysdiagrams.DeleteObject(sysdiagrams); } }
// GET: sysdiagrams/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } sysdiagrams sysdiagrams = db.sysdiagrams.Find(id); if (sysdiagrams == null) { return(HttpNotFound()); } return(View(sysdiagrams)); }
// DELETE: odata/sysdiagrams(5) public IHttpActionResult Delete([FromODataUri] int key) { sysdiagrams sysdiagrams = db.sysdiagrams.Find(key); if (sysdiagrams == null) { return(NotFound()); } db.sysdiagrams.Remove(sysdiagrams); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
public static Common.Business.sysdiagrams Fetch(sysdiagrams data) { Common.Business.sysdiagrams item = (Common.Business.sysdiagrams)Activator.CreateInstance(typeof(Common.Business.sysdiagrams)); //using (ObjectFactory.BypassPropertyChecks(item)) { item.name = data.name; item.principal_id = data.principal_id; item.diagram_id = data.diagram_id; item.version = data.version; item.definition = data.definition; } ObjectFactory.MarkAsChild(item); ObjectFactory.MarkOld(item); return(item); }
/// <summary> /// obriši item /// nije brisanje već postavljanje Deleted polja na true /// </summary> /// <param name="item">instanca entity objekta</param> /// <returns></returns> public bool Delete(sysdiagrams item) { bool uspjelo = false; using (KaFotkaEntities data = new KaFotkaEntities()) { item.Deleted = true; data.Entry <sysdiagrams>(item).State = System.Data.EntityState.Modified; data.SaveChanges(); uspjelo = true; } return(uspjelo); }
/// <summary> /// spremi item /// insert ako nema Id /// update ako ima Id /// </summary> /// <param name="item">instanca entity objekta</param> /// <returns></returns> public bool Save(sysdiagrams item) { bool uspjelo = false; using (Entities data = new Entities()) { data.sysdiagrams.Add(item); //ako ima Id onda je update if (item.Id != null) { data.Entry <sysdiagrams>(item).State = System.Data.EntityState.Modified; } data.SaveChanges(); uspjelo = true; } return(uspjelo); }
public IHttpActionResult Patch([FromODataUri] int key, Delta <sysdiagrams> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } sysdiagrams sysdiagrams = db.sysdiagrams.Find(key); if (sysdiagrams == null) { return(NotFound()); } patch.Patch(sysdiagrams); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!sysdiagramsExists(key)) { return(NotFound()); } else { throw; } } return(Updated(sysdiagrams)); }
public IQueryable <sysdiagrams> GetList(List <string> searchKeys, sysdiagrams model, Dictionary <string, object> searchParams, int?pageIndex, int?rowCount) { var modelQuery = MwtsEntities.sysdiagramss.AsQueryable(); if (searchKeys.Contains("name")) { modelQuery = modelQuery.Where(item => item.name == model.name); } if (searchKeys.Contains("principal_id")) { modelQuery = modelQuery.Where(item => item.principal_id == model.principal_id); } if (searchKeys.Contains("diagram_id")) { modelQuery = modelQuery.Where(item => item.diagram_id == model.diagram_id); } if (searchKeys.Contains("version")) { modelQuery = modelQuery.Where(item => item.version == model.version); } if (searchKeys.Contains("definition")) { modelQuery = modelQuery.Where(item => item.definition == model.definition); } if (pageIndex != null && rowCount != null) { int skip = ((int)pageIndex - 1) * (int)rowCount; int take = (int)rowCount; modelQuery = modelQuery.OrderBy(item => item.diagram_id).Skip(skip > 0?skip:0).Take(take); } if (searchParams.Count > 0) { //扩展查询条件 } return(modelQuery); }
public sysdiagrams SelectByKey(sysdiagrams entity) { object[] parameters = new object[] { entity.diagram_id }; return(Context.Database.SqlQuery <sysdiagrams>("dbo.usp_sysdiagramsSelect @diagram_id={0}", parameters).FirstOrDefault()); }
public void UpdateSysdiagrams(sysdiagrams currentsysdiagrams) { this.ObjectContext.sysdiagrams.AttachAsModified(currentsysdiagrams, this.ChangeSet.GetOriginal(currentsysdiagrams)); }
public bool Delete(sysdiagrams entity) { object[] parameters = new object[] { entity.diagram_id }; return(Context.Database.ExecuteSqlCommand("dbo.usp_sysdiagramsDelete @diagram_id={0}", parameters) == -1 ? true : false); }
/// <summary> /// There are no comments for sysdiagrams in the schema. /// </summary> public void AddTosysdiagrams(sysdiagrams sysdiagrams) { base.AddObject("sysdiagrams", sysdiagrams); }
/// <summary> /// Create a new sysdiagrams object. /// </summary> /// <param name="name">Initial value of name.</param> /// <param name="principal_id">Initial value of principal_id.</param> /// <param name="diagram_id">Initial value of diagram_id.</param> public static sysdiagrams Createsysdiagrams(string name, int principal_id, int diagram_id) { sysdiagrams sysdiagrams = new sysdiagrams(); sysdiagrams.name = name; sysdiagrams.principal_id = principal_id; sysdiagrams.diagram_id = diagram_id; return sysdiagrams; }
public void MarkAsModified(sysdiagrams item) { }
public IQueryable <sysdiagrams> GetList(List <string> searchKeys, sysdiagrams model, Dictionary <string, object> searchParams) { return(GetList(searchKeys, model, searchParams, null, null)); }
partial void Deletesysdiagrams(sysdiagrams instance);
partial void Updatesysdiagrams(sysdiagrams instance);
partial void Insertsysdiagrams(sysdiagrams instance);
public void Add(sysdiagrams model) { MwtsEntities.sysdiagramss.AddObject(model); Save(); }
public sysdiagrams Insert(sysdiagrams entity) { object[] parameters = new object[] { entity.name, entity.principal_id, entity.version, entity.definition }; return(Context.Database.SqlQuery <sysdiagrams>("dbo.usp_sysdiagramsInsert @name={0}, @principal_id={1}, @version={2}, @definition={3}", parameters).FirstOrDefault()); }