public FTSerEditResult GetEntityByID(WCFAuthInfoVM entity_WCFAuthInfoVM, string str_FTID) { try { //Retrieve Language And Session RetrieveLanguageAndSession(entity_WCFAuthInfoVM); List <string> strList_Error = new List <string>(); FTSerEditResult returnResult = new FTSerEditResult(); //Contruct Login User Respository CoolPrivilegeControlContext dbContext = CoolPrivilegeControlContext.CreateContext(); FunctionTypeRespository Respo_FT = new FunctionTypeRespository(dbContext, entity_BaseSession.ID); bool ret = false; ret = CheckAccPrivilege(entity_BaseSession.ID, entity_WCFAuthInfoVM.RequestFunKey, entity_WCFAuthInfoVM.RequestFunTypeKey, ref strList_Error); bool allowEdit = entity_BaseSession.CheckAccessRight("FTManage", "Edit", "", null); bool allowDel = entity_BaseSession.CheckAccessRight("FTManage", "Delete", "", null); if (ret) { FunctionTypeVM db_FunctionTypeVM = Respo_FT.GetEntityByID(Guid.Parse(str_FTID), languageKey, out strList_Error); db_FunctionTypeVM.AllowDel = allowDel; db_FunctionTypeVM.AllowEdit = allowEdit; returnResult.Entity_FunctionTypeVM = db_FunctionTypeVM; } returnResult.StrList_Error = strList_Error; return(returnResult); } catch (Exception ex) { throw new WebFaultException <WCFErrorContract>(new WCFErrorContract(ex), System.Net.HttpStatusCode.ExpectationFailed); } }
public FTSerEditResult GetEntityByID(WCFAuthInfoVM entity_WCFAuthInfoVM, string str_FTID) { try { //Retrieve Language And Session RetrieveLanguageAndSession(entity_WCFAuthInfoVM); List <string> strList_Error = new List <string>(); FTSerEditResult returnResult = new FTSerEditResult(); //Contruct Login User Respository CoolPrivilegeControlContext dbContext = CoolPrivilegeControlContext.CreateContext(); FunctionTypeRespository Respo_FT = new FunctionTypeRespository(dbContext, entity_BaseSession.ID); bool ret = false; ret = CheckAccPrivilege(entity_BaseSession.ID, entity_WCFAuthInfoVM.RequestFunKey, entity_WCFAuthInfoVM.RequestFunTypeKey, ref strList_Error); if (ret) { FunctionTypeVM db_FunctionTypeVM = Respo_FT.GetEntityByID(Guid.Parse(str_FTID), languageKey, out strList_Error); returnResult.Entity_FunctionTypeVM = db_FunctionTypeVM; } returnResult.StrList_Error = strList_Error; return(returnResult); } catch (Exception ex) { throw new FaultException <WCFErrorContract>(new WCFErrorContract(ex), ex.Message); } }