public FunctionResult <AppComponent> Get(int Id) { var r = new FunctionResult <AppComponent>(); r.Data = AppComponentDal.Get(Id); return(r); }
/// <summary> /// No safe TODO /// </summary> /// <param name="appId"></param> /// <param name="componentId"></param> /// <param name="appUserId"></param> /// <returns></returns> public FunctionOpenResult <bool> SetComponent(int appId, int componentId, int appUserId) { FunctionOpenResult <bool> r = new FunctionOpenResult <bool>(); var existResult = ExistComponent(appId, componentId, appUserId); if (existResult.ActionResult && existResult.Data) { Rel_AppComponent_AppUserDal.Delete(appId, componentId); } var list = AppComponentDal.GetList(new AppComponentSearchPamater() { ComponentId = componentId }); if (list != null) { list.ForEach(c => { Rel_AppComponent_AppUserDal.Add(new Rel_AppComponent_AppUser() { AppComponentId = c.AppComponentId, AppUserId = appUserId, AppId = appId }); }); } r.Data = true; return(r); }
public FunctionListResult <AppComponent> GetAppComponentListWithAppUser(int appId, int componentId) { var r = new FunctionListResult <AppComponent>(); r.Data = AppComponentDal.GetList(appId, componentId); return(r); }
public FunctionListResult <AppComponent> GetList(int appId, string name) { var r = new FunctionListResult <AppComponent>(); r.Data = AppComponentDal.GetList(appId, name); return(r); }
public FunctionResult <AppComponent> Create(AppComponent info) { var r = new FunctionResult <AppComponent>(); int id = AppComponentDal.Add(info); if (id > 0) { r.Data = info; r.Data.AppComponentId = id; } return(r); }
public FunctionOpenResult <bool> DeleteByID(List <int> idList) { var r = new FunctionOpenResult <bool>(); r.Data = AppComponentDal.Delete(idList); if (r.Data) { idList.ForEach(id => { AppComponentInterfaceDal.DeleteByAppComponentId(id); }); } return(r); }
public FunctionOpenResult <bool> UpdateByID(AppComponent info, List <String> interfaces) { var r = new FunctionOpenResult <bool>(); r.Data = AppComponentDal.Update(info) > 0; if (r.Data) { AppComponentInterfaceDal.DeleteByAppComponentId(info.AppComponentId); interfaces.ForEach(i => { AppComponentInterfaceDal.Add(new AppComponentInterface() { ComponentInterface = i, AppComponentId = info.AppComponentId }); }); } return(r); }
public FunctionResult <AppComponent> Create(AppComponent info, List <String> interfaces) { var r = new FunctionResult <AppComponent>(); int id = AppComponentDal.Add(info); if (id > 0) { r.Data = info; r.Data.AppComponentId = id; interfaces.ForEach(i => { AppComponentInterfaceDal.Add(new AppComponentInterface() { ComponentInterface = i, AppComponentId = id }); }); } return(r); }
public GridPager <AppComponent> GetPager(GridPagerPamater <AppComponentSearchPamater> searchParam) { var r = AppComponentDal.GetGridPager(searchParam); return(r); }
public FunctionListResult <AppComponent> GetList(AppComponentSearchPamater pamater) { var r = new FunctionListResult <AppComponent>(); r.Data = AppComponentDal.GetList(pamater); return(r); }
public FunctionOpenResult <bool> UpdateByID(AppComponent info) { var r = new FunctionOpenResult <bool>(); r.Data = AppComponentDal.Update(info) > 0; return(r); }