Beispiel #1
0
        public MemberOutput MemberbyID(int id)
        {
            if (id < 0)
            {
                return(null);
            }
            C02_BIMstaff item = db.C02_BIMstaff.Find(id);

            if (item == null)
            {
                return(null);
            }
            MemberOutput member = new MemberOutput()
            {
                ID         = item.BIMstaffID,
                SoftName   = item.Sortname,
                UserName   = item.Username,
                Password   = item.Password,
                Department = item.Deparment,
                UserType   = item.UserType,
                Image      = item.Image,
                UserStatus = item.UserStatus
            };

            return(member);
        }
Beispiel #2
0
        public List <MemberOutput> MemberbyTinhtrangLamViec(string tinhtrang)
        {
            if (tinhtrang == null || tinhtrang.Trim() == "")
            {
                return(null);
            }
            List <C02_BIMstaff> items = db.C02_BIMstaff.Where(s => s.UserStatus == tinhtrang).ToList();

            if (items == null || items.Count == 0)
            {
                return(null);
            }
            List <MemberOutput> lstMember = new List <MemberOutput>();

            foreach (C02_BIMstaff item in items)
            {
                MemberOutput it = new MemberOutput();
                it.ID         = item.BIMstaffID;
                it.SoftName   = item.Sortname;
                it.UserName   = item.Username;
                it.Password   = item.Password;
                it.Department = item.Deparment;
                it.UserType   = item.UserType;
                it.UserStatus = item.UserStatus;
                it.Image      = item.Image;
                lstMember.Add(it);
            }
            items.Clear();
            return(lstMember);
        }
Beispiel #3
0
 public MemberOutput Login(string userName, string password)
 {
     try
     {
         if (userName == null || userName.Trim() == "" || password == null)
         {
             return(null);
         }
         var userLogin = db.C02_BIMstaff.FirstOrDefault(s => s.Username == userName && s.Password == password);
         if (userLogin == null)
         {
             return(null);
         }
         MemberOutput userReturn = new MemberOutput();
         userReturn.ID         = userLogin.BIMstaffID;
         userReturn.UserName   = userLogin.Username;
         userReturn.SoftName   = userLogin.Sortname;
         userReturn.Password   = userLogin.Password;
         userReturn.UserType   = userLogin.UserType;
         userReturn.Department = userLogin.Deparment;
         userReturn.UserStatus = userLogin.UserStatus;
         userReturn.Image      = userLogin.Image;
         return(userReturn);
     }
     catch (System.Exception)
     {
         return(null);
     }
 }
Beispiel #4
0
        public MemberOutput MemberbyUsername(string username)
        {
            if (username == null || username.Trim() == "")
            {
                return(null);
            }
            C02_BIMstaff item = db.C02_BIMstaff.FirstOrDefault(s => s.Username == username);

            if (item == null)
            {
                return(null);
            }
            MemberOutput member = new MemberOutput()
            {
                ID         = item.BIMstaffID,
                SoftName   = item.Sortname,
                UserName   = item.Username,
                Password   = item.Password,
                Department = item.Deparment,
                UserType   = item.UserType,
                Image      = item.Image,
                UserStatus = item.UserStatus
            };

            return(member);
        }