Пример #1
0
        public string Book_Update(BookModel rm)
        {
            LibraryEntities3 lbe = new LibraryEntities3();
            string           msg = string.Empty;
            M_Book           mb  = lbe.M_Book.Where(c => c.BookID.Equals(rm.BookID)).SingleOrDefault();

            mb.BookName = rm.BookName;
            mb.BookType = rm.BookType;
            mb.PDF      = rm.PDF;
            try
            {
                lbe.SaveChanges();
                msg = "OK";
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
            }
            return(msg);
        }
Пример #2
0
        public string SaveUser(UserModel um)
        {
            LibraryEntities3 lbe = new LibraryEntities3();
            string           msg = string.Empty;
            M_User           mb  = new M_User();

            mb.UserID   = um.UserID;
            mb.UserName = um.UserName;
            mb.Password = um.Password;
            try
            {
                lbe.M_User.Add(mb);
                lbe.SaveChanges();
                msg = "OK";
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
            }
            return(msg);
        }
Пример #3
0
        //public DataTable BookDelete()
        //{
        //    BaseDL bdl = new BaseDL();
        //    SqlParameter[] prms = new SqlParameter[0];
        //    return bdl.SelectData("M_Delete_Book", prms);
        //}
        public string Book_Save(BookModel bm)
        {
            LibraryEntities3 lbe = new LibraryEntities3();
            string           msg = string.Empty;
            M_Book           mb  = new M_Book();

            mb.BookID   = bm.BookID;
            mb.BookName = bm.BookName;
            mb.BookType = bm.BookType;
            mb.PDF      = bm.PDF;
            try
            {
                lbe.M_Book.Add(mb);
                lbe.SaveChanges();
                msg = "OK";
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
            }
            return(msg);
        }
Пример #4
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);
        }
Пример #5
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);
        }