Пример #1
0
        public static int UpdatePicture(Member _member, byte[] image)
        {
            HANDZ_PEB_DBEntities all = new HANDZ_PEB_DBEntities();
            Member member            = all.Members.FirstOrDefault(memberDB => memberDB.Id == _member.Id);

            if (member != null)
            {
                member.Image = image;
            }
            return(all.SaveChanges());
        }
Пример #2
0
        public static int Add(Member member, string content)
        {
            UserNotification     notification = new UserNotification();
            HANDZ_PEB_DBEntities all          = new HANDZ_PEB_DBEntities();

            all.UserNotifications.Add(notification);

            notification.MemberID = member.Id;
            notification.Message  = content;
            notification.SentTime = DateTime.Now;

            return(all.SaveChanges());
        }
Пример #3
0
        public static int Add(Member member, string name, string path)
        {
            UserModel            model = new UserModel();
            HANDZ_PEB_DBEntities all   = new HANDZ_PEB_DBEntities();

            all.UserModels.Add(model);

            model.MemberID = member.Id;
            model.Name     = name;
            model.Path     = path;

            return(all.SaveChanges());
        }
Пример #4
0
        public static int UpdateInfo(Member _member, string fullName, string jop, string company, string phone, string address)
        {
            HANDZ_PEB_DBEntities all = new HANDZ_PEB_DBEntities();
            Member member            = all.Members.FirstOrDefault(memberDB => memberDB.Id == _member.Id);

            if (member != null)
            {
                member.FullName = fullName;
                member.Jop      = jop;
                member.Company  = company;
                member.Address  = address;
                member.Phone    = phone;
            }
            return(all.SaveChanges());
        }
Пример #5
0
        //constructor 3al sa5an mo2ktn
        public static int Add(MembershipUser validUser)
        {
            Member newMember = new Member();

            newMember.FullName = "";
            /* newMember.Image = System.IO.File.ReadAllBytes("~/layout/styles/images/TempPicture.jpg");*/ //edit
                                                                                                          //newMember.CityID = 1;
            newMember.Zip    = null;
            newMember.Gender = "";
            //newMember.BirthDate = new DateTime(1990,1,1);
            //newMember.RoleID = ;
            newMember.ASPuserID = (Guid)validUser.ProviderUserKey;

            HANDZ_PEB_DBEntities newone = new HANDZ_PEB_DBEntities();

            newone.Members.Add(newMember);
            return(newone.SaveChanges());
        }
Пример #6
0
        public static int Add(MembershipUser validUser, string fullName, /*byte[] image,*/ int cityId, string zip, string gender, DateTime bdate, int depId, int roleId)
        {
            Member newMember = new Member();

            newMember.FullName  = fullName;
            newMember.Image     = null;//edit
            newMember.Zip       = zip;
            newMember.Gender    = gender;
            newMember.BirthDate = bdate;
            //newMember.RoleID = roleId;
            newMember.IsDeleted = false;
            newMember.ASPuserID = (Guid)validUser.ProviderUserKey;
            //Roles.AddUserToRole(validUser.UserName, "");

            HANDZ_PEB_DBEntities newone = new HANDZ_PEB_DBEntities();

            newone.Members.Add(newMember);
            return(newone.SaveChanges());
        }