Example #1
0
        public string Check_Member(RegisterModel rm)
        {
            LibraryEntities3 lb     = new LibraryEntities3();
            string           msg    = string.Empty;
            M_Member         update = lb.M_Member.Where(c => c.MemberID.Equals(rm.MemberID)).SingleOrDefault();

            if (update != null)
            {
                msg = update.MemberID;
            }
            else
            {
                msg = "";
            }
            return(msg);
        }
Example #2
0
        public string Member_Save(RegisterModel rm)
        {
            string createdby = string.Empty;

            createdby = HttpContext.Current.Session["UserID"].ToString();
            LibraryEntities3 lbe = new LibraryEntities3();
            string           msg = string.Empty;
            M_Member         mb  = new M_Member();

            mb.MemberID   = rm.MemberID;
            mb.MemberName = rm.MemberName;
            //string pass = rm.MemberPassword;
            //string mpass=encryptpass(pass);
            //mb.MemberPassword = mpass;
            mb.MemberPassword = rm.MemberPassword;
            mb.ContactNo      = rm.ContactNo;
            mb.Address        = rm.Address;
            mb.Photo          = rm.Photo;
            mb.JoinDate       = Convert.ToDateTime(rm.JoinDate);
            mb.CreatedDate    = DateTime.Now;
            mb.CreatedBy      = createdby;
            mb.Gender         = rm.Gender;
            mb.Graduated      = rm.Graduated;
            mb.Master         = rm.Master;
            mb.Student        = rm.Student;
            try
            {
                lbe.M_Member.Add(mb);
                lbe.SaveChanges();
                msg = "OK";
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
            }
            return(msg);
        }
Example #3
0
        public string Member_Update(RegisterModel rm)
        {
            string updatedby = string.Empty;

            updatedby = HttpContext.Current.Session["UserID"].ToString();
            LibraryEntities3 lbe = new LibraryEntities3();
            string           msg = string.Empty;
            M_Member         mb  = lbe.M_Member.Where(c => c.MemberID.Equals(rm.MemberID)).SingleOrDefault();

            mb.MemberName = rm.MemberName;
            //string pass = rm.MemberPassword;
            //string dpass = Decryptdata(pass);
            //string mpass = encryptpass(dpass);
            //mb.MemberPassword = mpass;
            mb.MemberPassword = rm.MemberPassword;
            mb.ContactNo      = rm.ContactNo;
            mb.Address        = rm.Address;
            mb.Photo          = rm.Photo;
            mb.JoinDate       = Convert.ToDateTime(rm.JoinDate);
            mb.UpdatedDate    = DateTime.Now;
            mb.UpdatedBy      = updatedby;
            mb.Gender         = rm.Gender;
            mb.Graduated      = rm.Graduated;
            mb.Master         = rm.Master;
            mb.Student        = rm.Student;
            try
            {
                lbe.SaveChanges();
                msg = "OK";
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
            }
            return(msg);
        }