Exemplo n.º 1
0
        public ActionResult Edit(int Id)
        {
            WeeklyDoctorList weeklyDoctorList = new WeeklyDoctorList();

            weeklyDoctorList = WeeklyDoctorListServices.Instance.GetWeeklyDoctorList(Id);
            return(PartialView(weeklyDoctorList));
        }
 public void Update(WeeklyDoctorList weeklyDoctorList)
 {
     using (var context = new CBContext())
     {
         context.Entry(weeklyDoctorList).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
 public void SaveService(WeeklyDoctorList weeklyDoctorList)
 {
     using (var context = new CBContext())
     {
         context.WeeklyDoctorList.Add(weeklyDoctorList);
         context.SaveChanges();
     }
 }
 public void DeleteProduct(WeeklyDoctorList product)
 {
     using (var context = new CBContext())
     {
         context.Entry(product).State = System.Data.Entity.EntityState.Deleted;
         //context.catagories.Remove(catagory);
         context.SaveChanges();
     }
 }
Exemplo n.º 5
0
        public ActionResult Edit(WeeklyDoctorList weeklyDoctorList)
        {
            WeeklyDoctorList edit = WeeklyDoctorListServices.Instance.GetWeeklyDoctorList(weeklyDoctorList.Id);

            edit.Date       = weeklyDoctorList.Date;
            edit.DoctorName = weeklyDoctorList.DoctorName;
            edit.Day        = weeklyDoctorList.Day;
            edit.Serial     = weeklyDoctorList.Serial;
            edit.Time       = weeklyDoctorList.Time;

            WeeklyDoctorListServices.Instance.Update(edit);
            return(RedirectToAction("WeeklyDoctorList"));
        }
Exemplo n.º 6
0
        public ActionResult Appoint(AppointmentList appoinmentList)
        {
            AppointmentList appointmentList1 = new AppointmentList();

            appointmentList1.Date       = appoinmentList.Date;
            appointmentList1.DoctorName = appoinmentList.DoctorName;
            appointmentList1.Email      = appoinmentList.Email;
            appointmentList1.Name       = appoinmentList.Name;
            appointmentList1.Problem    = appoinmentList.Problem;
            appointmentList1.SerialNum  = appoinmentList.SerialNum;
            appointmentList1.Time       = appoinmentList.Time;
            if (WeeklyDoctorListServices.Instance.IsRemain(appoinmentList))
            {
                WeeklyDoctorList temp   = WeeklyDoctorListServices.Instance.GetSerialNum(appoinmentList);
                WeeklyDoctorList upload = WeeklyDoctorListServices.Instance.GetWeeklyDoctorList(temp.Id);
                upload.Serial++;
                WeeklyDoctorListServices.Instance.Update(upload);
                appointmentList1.SerialNum = upload.Serial;
                AppoinmentListsServices.Instance.SaveService(appointmentList1);

                SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
                client.EnableSsl      = true;
                client.DeliveryMethod = SmtpDeliveryMethod.Network;
                client.Credentials    = new NetworkCredential("*****@*****.**", "");
                MailMessage msg = new MailMessage();
                msg.To.Add(appointmentList1.Email);
                msg.From    = new MailAddress(appointmentList1.Email);
                msg.Subject = "From DUMC for appionment";
                msg.Body    = "Name: " + appointmentList1.Name.ToString() + "Problem: " + appointmentList1.Problem.ToString() + "Doctor Name: " +
                              appointmentList1.DoctorName.ToString() + "Date: " + appointmentList1.Date.ToString() +
                              "Time: " + appointmentList1.Time.ToString() + "Serial No:" + appointmentList1.SerialNum.ToString();

                client.Send(msg);
                //ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Successfully sent email');", true);


                return(RedirectToAction("WeeklyDoctorList"));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
Exemplo n.º 7
0
 public ActionResult Create(WeeklyDoctorList weeklyDoctorList)
 {
     WeeklyDoctorListServices.Instance.SaveService(weeklyDoctorList);
     return(RedirectToAction("WeeklyDoctorList"));
 }
Exemplo n.º 8
0
        public ActionResult Create()
        {
            WeeklyDoctorList weeklyDoctorList = new WeeklyDoctorList();

            return(PartialView(weeklyDoctorList));
        }