public List <UserProfileModel> RetrieveUserProfileByFilter(string sortParameter, List <SelectFilter> selectFilters) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.v_UserProfile select i; ApplyFilter <v_UserProfile>(ref query, selectFilters); ApplySorting <v_UserProfile>(ref query, "Code DESC", sortParameter); return(ObjectHelper.CopyList <v_UserProfile, UserProfileModel>(query.ToList())); }
public List <RoleDetailModel> RetrieveRoleActions(string moduleID) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.RoleDetail where i.ModuleID == moduleID select i; return(ObjectHelper.CopyList <RoleDetail, RoleDetailModel>(query.ToList())); }
public List <string> RetrieveRoleActions(int roleID, string moduleID) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.RoleDetail where i.RoleID == roleID && i.ModuleID == moduleID select i.Action; return(query.ToList()); }
public List <RoleModel> RetrieveRole(bool isActive) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.Role where i.IsActive == isActive select i; return(ObjectHelper.CopyList <Role, RoleModel>(query.ToList())); }
public void CreateRole(RoleModel role) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); Role obj = new Role(); ObjectHelper.CopyProperties(role, obj); ent.AddToRole(obj); ent.SaveChanges(); role.ID = obj.ID; }
public void UpdateCompanySetting(CompanySettingModel companySetting) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.CompanySetting select i; var obj = query.FirstOrDefault(); ObjectHelper.CopyProperties(companySetting, obj); ent.SaveChanges(); }
public List <CustomerModel> RetrieveCustomerAutoComplete(string key) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.Customer where (i.Name.ToLower().Contains(key.ToLower()) || i.Code.ToLower().Contains(key.ToLower())) && i.IsActive == true select i; ApplySorting <Customer>(ref query, "Code", ""); return(ObjectHelper.CopyList <Customer, CustomerModel>(query.Take(SystemConstants.AutoCompleteItemCount).ToList())); }
public void DeleteRoleDetails(long roleID) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.RoleDetail where i.RoleID == roleID select i; foreach (var obj in query.AsEnumerable()) { ent.DeleteObject(obj); } ent.SaveChanges(); }
public void CreateRoleDetails(int roleID, List <RoleDetailModel> roleDetailList) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); foreach (var roleDetail in roleDetailList) { roleDetail.RoleID = roleID; RoleDetail obj = new RoleDetail(); ObjectHelper.CopyProperties(roleDetail, obj); ent.AddToRoleDetail(obj); } ent.SaveChanges(); }
public MQUESTSYSReportEDSC.CompanySettingDTRow RetrieveCompanySetting() { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.CompanySetting select i; MQUESTSYSReportEDSC.CompanySettingDTRow dr = new MQUESTSYSReportEDSC.CompanySettingDTDataTable().NewCompanySettingDTRow(); if (query.FirstOrDefault() != null) { ObjectHelper.CopyProperties(query.FirstOrDefault(), dr); } else { return(null); } return(dr); }
public CompanySettingModel RetrieveCompanySetting() { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.CompanySetting select i; CompanySettingModel obj = new CompanySettingModel(); if (query.FirstOrDefault() != null) { ObjectHelper.CopyProperties(query.FirstOrDefault(), obj); } else { return(null); } return(obj); }
public CustomerModel RetrieveCustomerByCodeOrName(string key) { MQUESTSYSEntities ent = new MQUESTSYSEntities(); var query = from i in ent.v_Customer where i.Code == key || i.Name == key select i; var obj = new CustomerModel(); if (query.FirstOrDefault() != null) { ObjectHelper.CopyProperties(query.FirstOrDefault(), obj); } else { return(null); } return(obj); }