Beispiel #1
0
        public int CreateHistory(HistoryModel history)
        {
            //History objHistory = new History();
            history.IsActive    = true;
            history.CreatedDate = DateTime.Now.Date;
            history.UpdatedDate = DateTime.Now.Date;

            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    History obj = new History();
                    history.CopyProperties(obj);
                    db.Histories.Add(obj);
                    db.SaveChanges();
                    return(1);
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #2
0
        public int AddTestimonial(TestimonialsModel objTestimonial, HttpPostedFileBase file)
        {
            if (file != null)
            {
                MemoryStream target = new MemoryStream();
                file.InputStream.CopyTo(target);
                objTestimonial.PatientImage = target.ToArray();
            }

            objTestimonial.CreatedDate = DateTime.Now.Date;
            objTestimonial.UpdatedDate = DateTime.Now.Date;
            objTestimonial.IsActive    = true;
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    Testimonial testimonial = new Testimonial();
                    objTestimonial.CopyProperties(testimonial);
                    db.Testimonials.Add(testimonial);
                    return(db.SaveChanges());
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #3
0
 public int AddEmployee(EmployeeModel employee, HttpPostedFileBase file)
 {
     if (file != null)
     {
         MemoryStream ms = new MemoryStream();
         file.InputStream.CopyTo(ms);
         employee.Image = ms.ToArray();
     }
     employee.CreatedDate = DateTime.Now.Date;
     employee.UpdatedDate = DateTime.Now.Date;
     employee.IsActive    = true;
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         try
         {
             Employee emp = new Employee();
             employee.CopyProperties(emp);
             db.Employees.Add(emp);
             db.SaveChanges();
             return(1);
         }
         catch (Exception)
         {
             return(0);
         }
     }
 }
Beispiel #4
0
        public int AddService(ServicesModel objSerive, HttpPostedFileBase file)
        {
            if (file != null)
            {
                MemoryStream target = new MemoryStream();
                file.InputStream.CopyTo(target);
                objSerive.Image = target.ToArray();
            }

            objSerive.CreatedDate = DateTime.Now.Date;
            objSerive.UpdatedDate = DateTime.Now.Date;
            objSerive.IsActive    = true;
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    Service service = new Service();
                    objSerive.CopyProperties(service);
                    db.Services.Add(service);
                    db.SaveChanges();
                    return(1);
                }
                catch (DbEntityValidationException ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #5
0
        public int AddAbout(AboutClinicModel objAbout, HttpPostedFileBase file)
        {
            if (file != null)
            {
                MemoryStream target = new MemoryStream();
                file.InputStream.CopyTo(target);
                objAbout.Image = target.ToArray();
            }

            objAbout.CreatedDate = DateTime.Now.Date;
            objAbout.UpdatedDate = DateTime.Now.Date;
            objAbout.IsActive    = true;
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    AboutClinic obj = new AboutClinic();
                    objAbout.CopyProperties(obj);
                    db.AboutClinics.Add(obj);
                    db.SaveChanges();
                    return(1);
                }
                catch (DbEntityValidationException ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #6
0
 public void RemoveEmoployee(long empId)
 {
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         var emp = db.Employees.Where(m => m.EmpId == empId).FirstOrDefault();
         emp.IsActive = false;
         db.SaveChanges();
     }
 }
Beispiel #7
0
 public void DeleteTestimonial(int Id)
 {
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         var testimonial = db.Testimonials.Where(m => m.Id == Id).FirstOrDefault();
         testimonial.IsActive    = false;
         testimonial.UpdatedDate = DateTime.Now.Date;
         db.SaveChanges();
     }
 }
Beispiel #8
0
 public void DeleteHistory(long historyId)
 {
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         var history = db.Histories.Where(m => m.HistoryId == historyId).FirstOrDefault();
         history.IsActive    = false;
         history.UpdatedDate = DateTime.Now.Date;
         db.SaveChanges();
     }
 }
Beispiel #9
0
 public void DeleteService(long ServiceId)
 {
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         var service = db.Services.Where(m => m.ServiceId == ServiceId).FirstOrDefault();
         service.IsActive    = false;
         service.UpdatedDate = DateTime.Now.Date;
         db.SaveChanges();
     }
 }
Beispiel #10
0
 public void DeletePartialPage(long PartialPageId)
 {
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         var partialPage = db.PartialPages.Where(m => m.PartialPageId == PartialPageId).FirstOrDefault();
         partialPage.IsActive    = false;
         partialPage.UpdatedDate = DateTime.Now.Date;
         db.SaveChanges();
     }
 }
Beispiel #11
0
 public void DeleteAbout(long AboutId)
 {
     using (PhysioDevEntities db = new PhysioDevEntities())
     {
         var objAbout = db.AboutClinics.Where(m => m.Id == AboutId).FirstOrDefault();
         objAbout.IsActive    = false;
         objAbout.UpdatedDate = DateTime.Now.Date;
         db.SaveChanges();
     }
 }
        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 AddPhoto(Photo objPhoto)
        {
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    Gallery gallery = new Gallery();
                    objPhoto.CopyProperties(gallery);
                    db.Galleries.Add(gallery);
                    return(db.SaveChanges());
                }
                catch (Exception ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }
Beispiel #14
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);
                }
            }
        }
        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 #16
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 #17
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 #18
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 #19
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 #20
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;
                }
            }
        }
Beispiel #21
0
        public int AddPartialPage(Models.PartialPageModel obj)
        {
            obj.CreatedDate = DateTime.Now.Date;
            obj.UpdatedDate = DateTime.Now.Date;
            obj.IsActive    = true;
            using (PhysioDevEntities db = new PhysioDevEntities())
            {
                try
                {
                    PartialPage partialpage = new PartialPage();
                    obj.CopyProperties(partialpage);
                    db.PartialPages.Add(partialpage);
                    db.SaveChanges();
                    return(1);
                }
                catch (DbEntityValidationException ex)
                {
                    return(0);

                    throw ex;
                }
            }
        }