Esempio n. 1
0
        // GET: BillClass1/Delete/5
        public ActionResult Delete(int?id)
        {
            ViewBag.user = Session["uns"];
            ViewBag.role = Session["rol"];
            string user = ViewBag.user;
            string role = ViewBag.role;

            if ((Session["uns"] == null) || (Session["rol"].ToString() == "Admin") || (Session["rol"].ToString() == "Nurse") || (Session["rol"].ToString() == "Consultant"))
            {
                return(RedirectToAction("LoginPage", "LogClass1"));
            }
            else
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                BillClass1 billClass1 = db.BillClass1s.Find(id);
                if (billClass1 == null)
                {
                    return(HttpNotFound());
                }
                return(View(billClass1));
            }
        }
Esempio n. 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            BillClass1 billClass1 = db.BillClass1s.Find(id);

            db.BillClass1s.Remove(billClass1);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "bid,PatientId,pname,Appointment,AppointmentTime,DOB,Gender,Prescription,Amount,Lab_Amount,Total_Amount,Vat,Net_Amount,Status,cname")] BillClass1 billClass1)
        {
            if (ModelState.IsValid)
            {
                db.BillClass1s.Add(billClass1);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(billClass1));
        }
Esempio n. 4
0
        public ActionResult Edit([Bind(Include = "cpid,PatientId,pname,Appointment,AppointmentTime,DOB,Gender,Observation,ICD10,TreatmentPlan,Prescription,Amount,Status,cname")] ConsultantClass1 consultantClass1)
        {
            try
            {
                object o17 = consultantClass1.Status; string oo17 = o17.ToString();
                if (ModelState.IsValid)
                {
                    if (oo17 == "Consultant_Inbox")
                    {
                        db.Entry(consultantClass1).State = EntityState.Modified;
                        db.SaveChanges();
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        BillClass1 bc1 = new BillClass1();
                        bc1.PatientId       = consultantClass1.PatientId;
                        bc1.pname           = consultantClass1.pname;
                        bc1.Appointment     = consultantClass1.Appointment;
                        bc1.AppointmentTime = consultantClass1.AppointmentTime;
                        bc1.DOB             = consultantClass1.DOB;
                        bc1.Gender          = consultantClass1.Gender;
                        bc1.Prescription    = consultantClass1.Prescription;
                        bc1.Amount          = consultantClass1.Amount;
                        bc1.Total_Amount    = consultantClass1.Amount;
                        bc1.Net_Amount      = consultantClass1.Amount;
                        bc1.cname           = consultantClass1.cname;

                        db2.BillClass1s.Add(bc1);
                        db2.SaveChanges();              //data send to bills


                        db.Entry(consultantClass1).State = EntityState.Modified;
                        db.SaveChanges();               // update to consultant

                        return(RedirectToAction("Index"));
                    }
                }
            }
            catch (Exception e1) { ViewBag.err2 = e1.Message.ToString(); }
            return(View(consultantClass1));
            //try
            //{
            //    if (ModelState.IsValid)
            //    {
            //        db.Entry(consultantClass1).State = EntityState.Modified;
            //        db.SaveChanges();
            //        return RedirectToAction("Index");
            //    }
            //}
            //catch (Exception e1) { ViewBag.err1 = "User Already Exists"; ViewBag.err2 = e1.Message.ToString(); }
            //return View(consultantClass1);
        }
Esempio n. 5
0
        // GET: BillClass1/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BillClass1 billClass1 = db.BillClass1s.Find(id);

            if (billClass1 == null)
            {
                return(HttpNotFound());
            }
            return(View(billClass1));
        }
Esempio n. 6
0
        public ActionResult Edit([Bind(Include = "bid,PatientId,pname,Appointment,AppointmentTime,DOB,Gender,Prescription,Amount,Lab_Amount,Total_Amount,Vat,Net_Amount,Status,cname")] BillClass1 billClass1)
        {
            try
            {
                object o17 = billClass1.Status; string oo17 = o17.ToString();
                if (ModelState.IsValid)
                {
                    if (oo17 == "Bill_Inbox")
                    {
                        db.Entry(billClass1).State = EntityState.Modified;
                        db.SaveChanges();
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        FollowClass1 fc1 = new FollowClass1();
                        fc1.PatientId = billClass1.PatientId;
                        fc1.pname     = billClass1.pname;
                        //fc1.Appointment = "";
                        //fc1.AppointmentTime = "";
                        fc1.DOB    = billClass1.DOB;
                        fc1.Gender = billClass1.Gender;
                        fc1.cname  = billClass1.cname;

                        db2.FollowClass1s.Add(fc1);
                        db2.SaveChanges();              //data send to followsup


                        db.Entry(billClass1).State = EntityState.Modified;
                        db.SaveChanges();               // update to bills

                        //return RedirectToAction("Index");
                        return(Redirect("~/WebForm1.aspx?BillNo=" + billClass1.bid));
                    }
                }
            }
            catch (Exception e1) { ViewBag.err2 = e1.Message.ToString(); }
            return(View(billClass1));



            //if (ModelState.IsValid)
            //{
            //    db.Entry(billClass1).State = EntityState.Modified;
            //    db.SaveChanges();
            //    return RedirectToAction("Index");
            //}
            //return View(billClass1);
        }