当前位置: 首页>>代码示例>>C#>>正文


C# Models.User类代码示例

本文整理汇总了C#中WMS.Models.User的典型用法代码示例。如果您正苦于以下问题:C# User类的具体用法?C# User怎么用?C# User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


User类属于WMS.Models命名空间,在下文中一共展示了User类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的WMS.Models.User类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。