public int DeletePhoto(int PhotoId)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    var Photo = db.Galleries.Where(m => m.PhotoId == PhotoId).FirstOrDefault();
                    db.Entry(Photo).State = EntityState.Deleted; //Delete forever
                    //galleries.IsActive = false;
                    return(db.SaveChanges());
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
        public int UpdatePhoto(Photo objPhoto)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                objPhoto.CreatedOn = DateTime.Now.Date;
                try
                {
                    Photo photo = new Photo();
                    objPhoto.CopyProperties(photo);
                    db.Entry(photo).State = EntityState.Modified;
                    return(db.SaveChanges());
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #3
0
        public int UpdateAbout(AboutClinicModel objAbout)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                objAbout.UpdatedDate = DateTime.Now.Date;

                try
                {
                    AboutClinic objAboutClinic = new AboutClinic();
                    objAbout.CopyProperties(objAboutClinic);
                    db.Entry(objAboutClinic).State = EntityState.Modified;
                    db.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    return(0);
                }
            }
        }
Beispiel #4
0
        public int UpdateHistory(HistoryModel objHistory)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                objHistory.UpdatedDate = DateTime.Now.Date;
                try
                {
                    History history = new History();
                    objHistory.CopyProperties(history);
                    db.Entry(history).State = EntityState.Modified;
                    db.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #5
0
        public int UpdateTestimonial(TestimonialsModel objTestimonial)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                objTestimonial.UpdatedDate = DateTime.Now.Date;

                try
                {
                    Testimonial testimonial = new Testimonial();
                    objTestimonial.CopyProperties(testimonial);
                    db.Entry(testimonial).State = EntityState.Modified;
                    return(db.SaveChanges());
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #6
0
        public int UpdateEmployee(EmployeeModel employee)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                employee.UpdatedDate = DateTime.Now.Date;

                try
                {
                    Employee objEmp = new Employee();
                    employee.CopyProperties(objEmp);
                    objEmp.IsActive        = true;
                    db.Entry(objEmp).State = EntityState.Modified;
                    db.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    return(0);
                }
            }
        }
Beispiel #7
0
        public int UpdateService(ServicesModel objSerive)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                objSerive.UpdatedDate = DateTime.Now.Date;

                try
                {
                    Service service = new Service();
                    objSerive.CopyProperties(service);
                    db.Entry(service).State = EntityState.Modified;
                    db.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #8
0
        public int UpdatePartialPage(Models.PartialPageModel obj)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                obj.UpdatedDate = DateTime.Now.Date;

                try
                {
                    PartialPage partialPage = new PartialPage();
                    obj.CopyProperties(partialPage);
                    db.Entry(partialPage).State = EntityState.Modified;
                    db.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }