本文整理汇总了C#中WMS.Models.User类的典型用法代码示例。如果您正苦于以下问题:C# User类的具体用法?C# User怎么用?C# User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
User类属于WMS.Models命名空间,在下文中一共展示了User类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CheckDeleteActionPermission
private bool CheckDeleteActionPermission(User _User)
{
if (_User.CanDelete == true)
return true;
else
return false;
}
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:7,代码来源:CustomActionAttribute.cs
示例2: CheckCreateActionPermission
private bool CheckCreateActionPermission(User _User)
{
if (_User.CanAdd == true)
return true;
else
return false;
}
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:7,代码来源:CustomActionAttribute.cs
示例3: CheckForUserRole
public string CheckForUserRole(User user)
{
string val = "";
using (var ctx = new TAS2013Entities())
{
string criteria = ctx.UserAccesses.Where(aa => aa.UserID == user.UserID).FirstOrDefault().Criteria;
switch (criteria.Trim())
{
case "Z":
val = "Zone";
break;
case "R":
val="Region";
break;
case "C":
val = "City";
break;
case "L":
val = "Location";
break;
case "S":
val = "SuperUser";
break;
}
ctx.Dispose();
}
return val;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:29,代码来源:QueryBuilder.cs
示例4: CheckDetailActionPermission
private bool CheckDetailActionPermission(User _User)
{
if (_User.CanView == true)
return true;
else
return false;
}
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:7,代码来源:CustomActionAttribute.cs
示例5: CheckforPermission
public static bool CheckforPermission(User _User, ReportName _report)
{
bool check = false;
try
{
switch (_report)
{
case ReportName.Audit:
if (_User.MRAudit == true)
check = true;
break;
case ReportName.Daily:
if (_User.MRDailyAtt == true)
check = true;
break;
case ReportName.Detail:
if (_User.MRDetail == true)
check = true;
break;
case ReportName.Employee:
if (_User.MREmployee == true)
check = true;
break;
case ReportName.Grpah:
if (_User.MRGraph == true)
check = true;
break;
case ReportName.Leave:
if (_User.MRLeave == true)
check = true;
break;
case ReportName.ManualAtt:
if (_User.MRManualEditAtt == true)
check = true;
break;
case ReportName.Monthly:
if (_User.MRMonthly == true)
check = true;
break;
case ReportName.Summary:
if (_User.MRSummary == true)
check = true;
break;
}
}
catch (Exception ex)
{
check = false;
}
return check;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:51,代码来源:MyHelper.cs
示例6: MakeCustomizeQuery
public string MakeCustomizeQuery(User _user)
{
string query = " where ";
string subQuery = "";
string subQueryLoc = "";
List<string> _Criteria = new List<string>();
List<string> _CriteriaForOr = new List<string>();
List<string> _CriteriaForOrLoc = new List<string>();
TAS2013Entities db = new TAS2013Entities();
List<UserAccess> ulocs = new List<UserAccess>();
ulocs = db.UserAccesses.Where(aa => aa.UserID == _user.UserID).ToList();
foreach (var uloc in ulocs)
{
if(uloc.Criteria.Trim() == "Z")
_CriteriaForOrLoc.Add(" ZoneID = " + uloc.CriteriaData + " ");
if (uloc.Criteria.Trim() == "R")
_CriteriaForOrLoc.Add(" RegionID = " + uloc.CriteriaData + " ");
if (uloc.Criteria.Trim() == "C")
_CriteriaForOrLoc.Add(" CityID = " + uloc.CriteriaData + " ");
if (uloc.Criteria.Trim() == "L")
_CriteriaForOrLoc.Add(" LocID = " + uloc.CriteriaData + " ");
if (uloc.Criteria.Trim() == "S")
query = "";
if (uloc.Criteria.Trim() == "")
{
query = "";
return query;
}
}
for (int i = 0; i < _CriteriaForOrLoc.Count - 1; i++)
{
subQueryLoc = subQueryLoc + _CriteriaForOrLoc[i] + " or ";
}
if(_CriteriaForOrLoc.Count>0)
subQueryLoc = " ( " + subQueryLoc + _CriteriaForOrLoc[_CriteriaForOrLoc.Count - 1] + " ) ";
//subQuery = " ( ";
//for (int i = 0; i < _CriteriaForOr.Count - 1; i++)
//{
// subQuery = subQuery + _CriteriaForOr[i] + " or ";
//} if (_CriteriaForOr.Count > 0)
//subQuery = subQuery + _CriteriaForOr[_CriteriaForOr.Count - 1];
//subQuery = subQuery + " ) ";
query = query + subQueryLoc;
return query;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:49,代码来源:QueryBuilder.cs
示例7: QueryForCompanyFilters
public string QueryForCompanyFilters(User _User)
{
string query = "";
switch (_User.RoleID)
{
case 1:
break;
case 2:
query = " where CompanyID= 1 or CompanyID = 2 ";
break;
case 3:
query = " where CompanyID>= 3";
break;
case 4:
query = " where CompanyID = " + _User.CompanyID.ToString();
break;
case 5:
break;
}
return query;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:21,代码来源:QueryBuilder.cs
示例8: MakeCustomizeQueryForUserAccess
public string MakeCustomizeQueryForUserAccess(User _user)
{
TAS2013Entities db = new TAS2013Entities();
string query = "where";
List<UserAccess> uAcc = new List<UserAccess>();
uAcc = db.UserAccesses.Where(aa => aa.UserID == _user.UserID).ToList();
foreach (var access in uAcc)
{
if (access.Criteria.Contains("L"))
query = query + " LocID = " + access.CriteriaData + " ";
if (access.Criteria.Contains("S"))
query = query + " LocID>0";
}
return query;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:16,代码来源:QueryBuilder.cs
示例9: LoadShiftGrid
private void LoadShiftGrid(User _loggedUser)
{
List<Shift> _objectList = new List<Shift>();
_objectList = context.Shifts.Where(aa => aa.CompanyID == _loggedUser.CompanyID).ToList();
//_Query = "SELECT * FROM TAS2013.dbo.EmpType where " + selectSQL;
//grid_EmpType.DataSource = GetValuesFromDatabase(_Query, "EmpType");
//grid_EmpType.DataBind();
grid_Shift.DataSource = _objectList;
grid_Shift.DataBind();
}
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:10,代码来源:MSummary.aspx.cs
示例10: LoadSectionGrid
private void LoadSectionGrid(User _loggedUser)
{
QueryBuilder qb = new QueryBuilder();
string query = qb.QueryForCompanySegeration(_loggedUser);
DataTable dt = qb.GetValuesfromDB("select * from ViewSection " + query);
List<ViewSection> _View = dt.ToList<ViewSection>();
grid_Section.DataSource = _View;
grid_Section.DataBind();
}
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:9,代码来源:MSummary.aspx.cs
示例11: LoadShiftView
private void LoadShiftView(User _loggedUser)
{
}
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:3,代码来源:YLvConsumed.aspx.cs
示例12: QueryForUserAccess
public string QueryForUserAccess(User _User, string view)
{
string role="";
string query = "";
using (var context = new TAS2013Entities())
{
role = context.UserRoles.Where(aa => aa.RoleID == _User.RoleID).FirstOrDefault().RoleName;
}
switch (view)
{
case "Region": query= UserAcccessGetRegion(_User,role);
return query;
case "Zone": query = UserAcccessGetZone(_User, role);
return query;
case "Location": query = UserAcccessGetLocation(_User, role);
return query;
case "City": query = UserAccessGetCity(_User, role);
return query;
case "SuperUser": query = "CompanyID >0";
return query;
}
return query;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:25,代码来源:QueryBuilder.cs
示例13: QueryForReportsCity
internal string QueryForReportsCity(User LoggedInUser, string p)
{
string query = " where ";
TAS2013Entities db = new TAS2013Entities();
List<UserAccess> uAcc = new List<UserAccess>();
uAcc = db.UserAccesses.Where(aa => aa.UserID == LoggedInUser.UserID).ToList();
List<Region> regions = db.Regions.ToList();
List<City> cities = db.Cities.ToList();
List<Location> locs = db.Locations.ToList();
List<string> queryList = new List<string>();
foreach (var access in uAcc)
{
switch (LoggedInUser.RoleID)
{
case 1://Super ADmin
query = "";
break;
case 4://Zone
List<City> city = db.Cities.Where(aa => aa.Region.ZoneID== access.CriteriaData).ToList();
foreach (var c in city)
{
queryList.Add(" CityID =" + c.CityID);
}
break;
case 5://REgion
city = db.Cities.Where(aa => aa.RegionID == access.CriteriaData).ToList();
foreach (var c in city)
{
queryList.Add(" CityID =" + c.CityID);
}
break;
case 6://City
string cityID = cities.Where(aa => aa.CityID == access.CriteriaData).FirstOrDefault().CityID.ToString();
queryList.Add(" CityID =" + cityID);
break;
case 7://Location
string cityIDForLoc = locs.Where(aa => aa.LocID == access.CriteriaData).FirstOrDefault().CityID.ToString();
queryList.Add(" CityID =" + cityIDForLoc);
break;
}
}
if (queryList.Count == 1)
{
query = query + queryList[0];
}
else if (queryList.Count > 1)
{
for (int i = 0; i < queryList.Count - 1; i++)
{
query = query + queryList[i] + " or ";
}
query = query + queryList[queryList.Count - 1];
}
return query;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:57,代码来源:QueryBuilder.cs
示例14: QueryForCompanyFilters
public string QueryForCompanyFilters(User _User)
{
string query = "";
//switch (_User.RoleID)
//{
// case 1:
// break;
// case 2:
// query = " where CompanyID= 1 or CompanyID = 2 ";
// break;
// case 3:
// query = " where CompanyID>= 3";
// break;
// case 4:
// query = " where CompanyID = " + _User.ToString();
// break;
// case 5:
// break;
//}
return query;
}
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:21,代码来源:QueryBuilder.cs
示例15: QueryForCompanyViewLinq
public string QueryForCompanyViewLinq(User _User)
{
string query = "";
switch (_User.RoleID)
{
case 1: query = "CompID > 0";
break;
case 2:
query = "CompID= 1 or CompID = 2 ";
break;
case 3:
query = "CompID>= 3";
break;
case 4:
query = "CompID = " + _User.CompanyID.ToString();
break;
case 5:
break;
}
return query;
}
开发者ID:ahsinanwar,项目名称:WMSNHA2016,代码行数:21,代码来源:QueryBuilder.cs
示例16: QueryForCompanyViewLinq
public string QueryForCompanyViewLinq(User _User)
{
string query = "";
//switch (_User.RoleID)
// {
// case 1: query ="CompID > 0";
// break;
// case 2:
// query = "CompID= 1 or CompID = 2 ";
// break;
// case 3:
// query = "CompID>= 3";
// break;
// case 4:
// query = "CompID = " + _User.ToString();
// break;
// case 5:
// break;
// }
return query;
}
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:21,代码来源:QueryBuilder.cs
示例17: QueryForLocationFilters
public string QueryForLocationFilters(User _user)
{
TAS2013Entities db = new TAS2013Entities();
//List<UserLocation> ulocs = new List<UserLocation>();
//List<string> _CriteriaForOrLoc = new List<string>();
//ulocs = db.UserLocations.Where(aa => aa.UserID == _user.UserID).ToList();
string query = "";
//foreach (var uloc in ulocs)
//{
// _CriteriaForOrLoc.Add(" LocID = " + uloc.LocationID + " ");
//}
//for (int i = 0; i < _CriteriaForOrLoc.Count - 1; i++)
//{
// query = query + _CriteriaForOrLoc[i] + " or ";
//}
//query = query + _CriteriaForOrLoc[_CriteriaForOrLoc.Count - 1];
return query;
}
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:18,代码来源:QueryBuilder.cs
示例18: MakeCustomizeQuery
public string MakeCustomizeQuery(User _user)
{
string query = " where ";
string subQuery = "";
string subQueryLoc = "";
List<string> _Criteria = new List<string>();
List<string> _CriteriaForOr = new List<string>();
List<string> _CriteriaForOrLoc = new List<string>();
//if (_user.ViewLocation == true)
// {
// _Criteria.Add(" LocID = " + _user.LocationID.ToString());
// }
TAS2013Entities db= new TAS2013Entities();
List<UserLocation> ulocs = new List<UserLocation>();
ulocs = db.UserLocations.Where(aa => aa.UserID == _user.UserID).ToList();
foreach (var uloc in ulocs)
{
_CriteriaForOrLoc.Add(" LocID = " + uloc.LocationID + " ");
}
if (_user.ViewContractual == true)
{
_CriteriaForOr.Add(" CatID = 3 ");
}
if (_user.ViewPermanentMgm == true)
{
_CriteriaForOr.Add(" CatID = 2 ");
}
if (_user.ViewPermanentStaff == true)
{
_CriteriaForOr.Add(" CatID = 4 ");
}
_CriteriaForOr.Add(" CatID=1 ");
switch (_user.RoleID)
{
case 1:
break;
case 2:
_Criteria.Add(" CompanyID= 1 or CompanyID = 2 ");
break;
case 3:
_Criteria.Add(" CompanyID>= 3");
break;
case 4:
_Criteria.Add(" CompanyID = "+_user.CompanyID.ToString());
break;
case 5:
break;
}
for (int i = 0; i < _Criteria.Count; i++ )
{
query = query + _Criteria[i] + " and ";
}
for (int i = 0; i < _CriteriaForOrLoc.Count-1; i++)
{
subQueryLoc = subQueryLoc + _CriteriaForOrLoc[i] + " or ";
}
if(_CriteriaForOrLoc.Count !=0)
subQueryLoc = " and ( " + subQueryLoc + _CriteriaForOrLoc[_CriteriaForOrLoc.Count-1] + " ) ";
//query = query + " ) and (";
//query = query + _Criteria[_Criteria.Count-1];
subQuery = " ( ";
for (int i = 0; i < _CriteriaForOr.Count - 1; i++)
{
subQuery = subQuery + _CriteriaForOr[i] + " or ";
}
subQuery = subQuery + _CriteriaForOr[_CriteriaForOr.Count - 1];
subQuery = subQuery + " ) ";
query = query + subQuery + subQueryLoc;
return query;
}
开发者ID:linkstatic12,项目名称:WMS-Fatima,代码行数:72,代码来源:QueryBuilder.cs
示例19: MakeCustomizeQuery
public string MakeCustomizeQuery(User _user)
{
string RoleQuery = "";
string CatQuery = "";
TAS2013Entities db = new TAS2013Entities();
List<UserRoleData> userRoleData = new List<UserRoleData>();
List<string> UserRoleString = new List<string>();
List<string> CategoryUser = new List<string>();
CategoryUser.Add(" where (CatID=1 ");
if (_user.ViewContractual == true)
{
CategoryUser.Add(" CatID = 4 ");
}
if (_user.ViewPermanentMgm == true)
{
CategoryUser.Add(" CatID = 2 ");
}
if (_user.ViewPermanentStaff == true)
{
CategoryUser.Add(" CatID = 3 ");
}
userRoleData = db.UserRoleDatas.Where(aa => aa.RoleUserID == _user.UserID).ToList();
switch (_user.UserRoleD)
{
case "A"://Admin
break;
case "C"://City
foreach (var urd in userRoleData)
{
UserRoleString.Add(" CityID = " + urd.RoleDataValue + " ");
}
break;
case "D"://Department
foreach (var urd in userRoleData)
{
UserRoleString.Add(" DeptID = " + urd.RoleDataValue + " ");
}
break;
case "E"://Single Employee
foreach (var urd in userRoleData)
{
UserRoleString.Add(" EmpID = " + urd.RoleDataValue + " ");
}
break;
case "L"://Location
foreach (var urd in userRoleData)
{
UserRoleString.Add(" LocID = " + urd.RoleDataValue + " ");
}
break;
case "R"://Region
foreach (var urd in userRoleData)
{
UserRoleString.Add(" RegionID = " + urd.RoleDataValue + " ");
}
break;
case "S"://Section
foreach (var urd in userRoleData)
{
UserRoleString.Add(" SecID = " + urd.RoleDataValue + " ");
}
break;
case "V"://Division
foreach (var urd in userRoleData)
{
UserRoleString.Add(" DivID = " + urd.RoleDataValue + " ");
}
break;
case "W"://Crew
foreach (var urd in userRoleData)
{
UserRoleString.Add(" CrewID = " + urd.RoleDataValue + " ");
}
break;
}
if (UserRoleString.Count == 1)
{
RoleQuery = " and (" + RoleQuery + UserRoleString[0] + " ) ";
}
else if(UserRoleString.Count>1)
{
RoleQuery = RoleQuery + " and ( ";
for (int i = 0; i < UserRoleString.Count - 1; i++)
{
RoleQuery = RoleQuery + UserRoleString[i] + " or ";
}
RoleQuery = RoleQuery + UserRoleString[UserRoleString.Count - 1] + " ) ";
}
if (CategoryUser.Count == 1)
CatQuery = CatQuery + CategoryUser[0]+" ) ";
else if(CategoryUser.Count>1)
{
for (int i = 0; i < CategoryUser.Count-1; i++)
{
CatQuery = CatQuery + CategoryUser[i] + " or ";
}
CatQuery = CatQuery + CategoryUser[CategoryUser.Count - 1] + " ) ";
}
//.........这里部分代码省略.........
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:101,代码来源:QueryBuilder.cs
示例20: QueryForLocationTableSegerationForLinq
internal string QueryForLocationTableSegerationForLinq(User LoggedInUser)
{
TAS2013Entities db = new TAS2013Entities();
//List<UserLocation> ulocs = new List<UserLocation>();
//List<string> _CriteriaForOrLoc = new List<string>();
//ulocs = db.UserLocations.Where(aa => aa.UserID == LoggedInUser.UserID).ToList();
String query = "";
//foreach (var uloc in ulocs)
//{
// _CriteriaForOrLoc.Add(" LocID = " + uloc.LocationID + " ");
//}
//for (int i = 0; i < _CriteriaForOrLoc.Count - 1; i++)
//{
// query = query + _CriteriaForOrLoc[i] + " or ";
//}
//if (_CriteriaForOrLoc.Count != 0)
// query = query + _CriteriaForOrLoc[_CriteriaForOrLoc.Count - 1];
//else
// query = "LocID > 0";
return query;
}
开发者ID:ahsinanwar,项目名称:SingleCompany,代码行数:21,代码来源:QueryBuilder.cs
注:本文中的WMS.Models.User类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论