Beispiel #1
0
        public static bool IsUserInRole(string userName, string roleName)
        {
            ECountContext _context = new ECountContext();
            int           count    = _context.User.Count(u => u.UserName == userName && u.UserGroup.GroupName == roleName);

            return((count > 0) ? true : false);
        }
Beispiel #2
0
        public void AddRelationTest()
        {
            PartSegmentBLL target       = new PartSegmentBLL(); // TODO: Initialize to an appropriate value
            PartSegment    relation     = null;                 // TODO: Initialize to an appropriate value
            ECountContext  outerContext = null;                 // TODO: Initialize to an appropriate value
            bool           saveChanges  = false;                // TODO: Initialize to an appropriate value

            target.AddRelation(relation, saveChanges);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Beispiel #3
0
        public List <Workshop> GetWorkshopbyPlantID(int plantID)
        {
            ECountContext   _context = new ECountContext();
            List <Workshop> wsList   = _context.Workshop.Include("Plant").Where(p => p.Plant.PlantID == plantID && p.Available == true).ToList();

            if (wsList != null && wsList.Count > 0)
            {
                return(wsList);
            }
            return(new List <Workshop>());
        }
Beispiel #4
0
        public bool Validate(string userName, string password)
        {
            ECountContext _context = new ECountContext();
            User          user     = _context.User.Single(u => string.Compare(userName, u.UserName, true) == 0);

            if (user == null || user.Password != password)
            {
                return(false);
            }
            return(true);
        }
Beispiel #5
0
        public List <Operation> GetOperations()
        {
            // return GetObjects().ToList();
            // Temporary usage to get menus only
            ECountContext    _context = new ECountContext();
            List <Operation> opList   = _context.Operation.Where(p => p.ParentOperationID == null).ToList();

            if (opList != null && opList.Count > 0)
            {
                return(opList);
            }
            return(new List <Operation>());
        }
Beispiel #6
0
 public BizParamsBLL(ECountContext context)
     : base(context, "BizParams")
 {
 }
Beispiel #7
0
 public StoreLocationBLL(ECountContext context)
     : base(context, "StoreLocation")
 {
 }
Beispiel #8
0
 public WorkshopBLL(ECountContext context)
     : base(context, "Workshop")
 {
 }
Beispiel #9
0
 public BaseGenericBLL(ECountContext context, string entitySetName)
 {
     this._context  = context;
     _entitySetName = _context.DefaultContainerName + "." + entitySetName;
 }
Beispiel #10
0
 public BaseGenericBLL(string entitySetName)
 {
     _context = new ECountContext();
     _context.CommandTimeout = 300;
     _entitySetName          = _context.DefaultContainerName + "." + entitySetName;
 }
Beispiel #11
0
 public StockTakeReqBLL(ECountContext context)
     : base(context, "StocktakeRequest")
 {
 }
Beispiel #12
0
 public StocktakeDetailBLL(ECountContext context)
     : base(context, "StocktakeDetailBLL")
 {
 }
Beispiel #13
0
 public PlantBLL(ECountContext context)
     : base(context, "Plant")
 {
 }
Beispiel #14
0
 public WorkshopStocktakeDetailBLL(ECountContext context)
     : base(context, "WorkshopStocktakeDetail")
 {
 }