示例#1
0
        public static UserInfo Authenticate(UserInfo user)
        {
            model1 context = new model1();
            var    check   = context.Users.Where(i => i.Name == user.Name && i.Pass == user.Pass).Select(i => i).FirstOrDefault();

            return(check);
        }
示例#2
0
        public static void CreateRequest(NewRequest req)
        {
            model1 context = new model1();

            context.Request.Add(req);
            context.SaveChanges();
        }
示例#3
0
        public static void update(int r, string s)
        {
            model1 context = new model1();
            var    temp    = context.Request.Where(i => i.Id == r).FirstOrDefault();

            temp.Status = s;
            context.SaveChanges();
        }
示例#4
0
        public static void update(int r, int e, int t)
        {
            model1         context = new model1();
            UpdatedRequest up      = new UpdatedRequest();

            up.Request        = context.Request.Where(i => i.Id == r).Select(i => i).FirstOrDefault();
            up.Request.Status = "Assigned";
            up.Executive      = context.Users.Where(i => i.Id == e).Select(i => i).FirstOrDefault();
            up.Trainer        = context.Trainers.Where(i => i.Id == t).Select(i => i).FirstOrDefault();
            context.UpdatedReq.Add(up);
            context.SaveChanges();
        }
示例#5
0
        public static List <NewRequest> ViewCreatedRequest()
        {
            model1 context = new model1();

            return(context.Request.ToList());
        }