예제 #1
0
        public bool AddOrg(b01 org, b01Expansion orge)
        {
            CQGJPassportEntities CQGJ = new CQGJPassportEntities();
            orge.b01 = org;
            if (org.b0111 == orge.b01.b0111)
            {
                try
                {
                    CQGJ.AddTob01(org);
                    CQGJ.AddTob01Expansion(orge);

                    CQGJ.SaveChanges();
                    return true;
                }
                catch
                {

                }

            }
            return false;
        }
예제 #2
0
 public bool SavePswChange(int userID, string Password)
 {
     if (userID != 0 && Password != "")
     {
         try
         {
             CQGJPassportEntities cqgj = new CQGJPassportEntities();
             User user = (from c in cqgj.User
                          where c.UserID == userID
                          select c).First();
             user.Password = CQGJ.Core.Security.MD5Encrypt(Password);
             cqgj.SaveChanges();
             return true;
         }
         catch
         {
             return false;
         }
     }
     return false;
 }
예제 #3
0
 public bool SaveOrgChange(b01 Org, b01Expansion OrgEx)
 {
     OrgEx.b01 = Org;
     CQGJPassportEntities CQGJ = new CQGJPassportEntities();
     b01 newOrg = (from c in CQGJ.b01
                   where c.b0111 == Org.b0111
                   select c).First();
     b01Expansion newOrgEx = (from d in CQGJ.b01Expansion
                              where d.ID == OrgEx.ID
                              select d).First();
     newOrg.b0101 = Org.b0101;
     newOrgEx.Mail = OrgEx.Mail;
     newOrgEx.Mobile = OrgEx.Mobile;
     newOrgEx.Tel = OrgEx.Tel;
     if (newOrgEx.b01==newOrg)
     {
         int i= CQGJ.SaveChanges();
         return true;
     }
     return false;
 }
예제 #4
0
        public bool SavaUserChange(User user)
        {
            try
            {
                int userID = user.UserID;
                CQGJPassportEntities CQGJ = new CQGJPassportEntities();
                User localUser = (from c in CQGJ.User
                                  where c.UserID == userID
                                  select c).First();

                localUser.Username = user.Username;
                localUser.Gender = user.Gender;
                localUser.Nation = user.Nation;
                localUser.Birthday = user.Birthday;
                localUser.Politics = user.Politics;
                localUser.IDCard = user.IDCard;
                localUser.WorkTel = user.WorkTel;
                localUser.Cellphone = user.Cellphone;
                localUser.Position = user.Position;
                localUser.JoinWorkDate = user.JoinWorkDate;
                localUser.Remark = user.Remark;
                localUser.Status = user.Status;
                localUser.Class = user.Class;
                localUser.RelationsCode = user.RelationsCode;
                localUser.RelationsName = user.RelationsName;
                localUser.Photo = user.Photo;
                localUser.PhotoType = user.PhotoType;
                CQGJ.SaveChanges();
                return true;
            }
            catch
            {
                return false;
            }
        }