Exemple #1
0
 public ActionResult ViewBills(int billid, DateTime billdate)
 {
     if (billid > 0)
     {
         string str = PrintGenerator.GenerateBillPDF(billid, Convert.ToInt32(Session["patientid"].ToString()), Convert.ToInt32(Session["hospital"].ToString()), billdate);
         TempData["Print"] = str;
         return(RedirectToAction("Print", "Shared"));
     }
     else
     {
         return(View());
     }
 }
        public ActionResult Checkout(FormCollection form, string SubmitBtn)
        {
            try
            {
                List <BillParticulars> par = new List <BillParticulars>();
                if (Session["OTBillParticulars"] != null)
                {
                    PatientBill pb = new PatientBill();
                    if (SubmitBtn == "Checkout")
                    {
                        pb.CMD = "Save";
                    }
                    else
                    {
                        pb.CMD = SubmitBtn;
                    }

                    pb.parlist     = par = (List <BillParticulars>)Session["OTBillParticulars"];
                    pb.totalamount = par.Select(q => q.total).Sum();
                    pb.patientid   = Convert.ToInt32(Session["patientid"] == null ? '0' : Session["patientid"]);
                    pb.hid         = Convert.ToInt32(Session["hospital"] == null ? '0' : Session["hospital"]);
                    string billid = pb.PerformAction();
                    string str    = PrintGenerator.GenerateBillPDF(Convert.ToInt32(billid.ToString()), pb.patientid, pb.hid, DateTime.Now);
                    TempData["Print"] = str;
                    return(RedirectToAction("Print", "Shared"));
                }
                else
                {
                    return(RedirectToAction("Bill", "OT"));
                }
            }
            catch (Exception)
            {
                return(RedirectToAction("Bill", "OT"));
            }
        }