public ActionResult TemplateEdit(Mikhailova_docTypeTemplates item) { var mng = new ContractsManager(); mng.SaveDocTypeTemplate(item); return(Json(new { result = true })); }
public Mikhailova_docTypeTemplates GetDocTypeTemplate(int id) { var res = new Mikhailova_docTypeTemplates(); res = db.GetDocTypeTemplate(id); return(res); }
public int SaveDocTypeTemplate(Mikhailova_docTypeTemplates item) { try { if (item.id == 0) { db.Mikhailova_docTypeTemplates.Add(item); db.SaveChanges(); } else { try { db.Entry(item).State = EntityState.Modified; db.SaveChanges(); } catch (OptimisticConcurrencyException ex) { RDL.Debug.LogError(ex); } } } catch (Exception ex) { RDL.Debug.LogError(ex); } return(item.id); }
public void SaveDocTypeTemplate(Mikhailova_docTypeTemplates item) { try { db.SaveDocTypeTemplate(item); } catch (Exception ex) { RDL.Debug.LogError(ex); } }
public void SaveDocTypeTemplate(Mikhailova_docTypeTemplates item) { try { _db.SaveDocTypeTemplate(item); } catch (Exception ex) { _debug(ex, new { item }, ""); } }
public Mikhailova_docTypeTemplates GetDocTypeTemplate(int id) { var res = new Mikhailova_docTypeTemplates(); try { res = _db.GetDocTypeTemplates().FirstOrDefault(x => x.id == id); } catch (Exception ex) { _debug(ex, new { id }, "id"); } return(res); }
public ActionResult CreateTemplate(string name, int typeID, string path, int ord) { var mng = new ContractsManager(); var item = new Mikhailova_docTypeTemplates { id = 0, name = name, typeID = typeID, path = path, ord = ord }; mng.SaveDocTypeTemplate(item); return(Json(new { result = item.id > 0, savedID = item.id, }, JsonRequestBehavior.AllowGet)); }
public int SaveDocTypeTemplate(Mikhailova_docTypeTemplates element, bool withSave = true) { if (element.id == 0) { db.Mikhailova_docTypeTemplates.Add(element); } else { db.Entry(element).State = EntityState.Modified; } if (withSave) { Save(); } return(element.id); }