public static bool Insert(Guid id, Guid sid, Guid aid, Guid gid, string address, Guid dtid) { try { using (var context = new CentralProcessContext()) { var data = StoreBranchVM.set(id, sid, aid, gid, address, dtid); context.StoreBranchDB.Add(data); context.SaveChanges(); return true; } } catch { return false; } }
public static StoreBranchVM SetSubData(StoreBranch data, Guid aid, Guid lcid) { var model = StoreBranchVM.MToVM(data); model.Geolocation = LocationStorageVM.MToVM(LocationStorageService.GetByIDOID(data.GeoLocationID, data.ID, lcid)); return model; }