public HttpResponseMessage Save(XtraVm model) { var toRet = _blObj.Save(ApiCommon.CurrentUserId, model); var response = Request.CreateResponse(HttpStatusCode.OK, toRet); return(response); }
public XtraVm Save(long userId, XtraVm toSave) { var obj = toSave.Xtra; PreSave(userId, ref obj, toSave.ActionMode); toSave.Xtra = obj; switch (toSave.ActionMode) { case Enumerations.ActionMode.Add: toSave.Xtra = Create(userId, toSave.Xtra); break; case Enumerations.ActionMode.Edit: toSave.Xtra = Edit(userId, toSave.Xtra); break; } return(Init(userId, toSave.Xtra.Object, toSave.Xtra.Id, toSave.Xtra.Property)); }
public XtraVm Init(long userId, string Object, long id, string property) { long branchId = 0; var toRet = new XtraVm { ActionMode = Enumerations.ActionMode.Add, Properties = BlCode.LoadTable(userId, "ProductOpenProperty_" + branchId, "", branchId.ToString()), Xtra = new Xtra { Object = Object, Id = id } }; if (property != "null") { var obj = LoadSingle(userId, Object, id, property); toRet.Xtra = obj; toRet.ActionMode = Enumerations.ActionMode.Edit; } return(toRet); }