示例#1
0
        public ActionResult AddDiagnosis(OPDDiagnosis c, List <HttpPostedFileBase> Attachment)
        {
            string fileLocation         = "";
            string ItemUploadFolderPath = "~/DataImages/";

            try
            {
                try
                {
                    if (Attachment.Count > 0)
                    {
                        foreach (HttpPostedFileBase file in Attachment)
                        {
                            try
                            {
                                if (file.ContentLength == 0)
                                {
                                    continue;
                                }

                                if (file.ContentLength > 0)
                                {
                                    fileLocation = HelperFunctions.renameUploadFile(file, ItemUploadFolderPath);
                                    if (fileLocation == "")
                                    {
                                        fileLocation = "";
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                            }

                            if (fileLocation == "" || fileLocation == null)
                            {
                                c.Attachment = c.Attachment;
                            }
                            else
                            {
                                c.Attachment = fileLocation;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            catch (Exception ex)
            {
            }



            try
            {
                if (dl.InsertOPDDiagnosis_Sp(c) > 0)
                {
                    TempData["PaymentMSG"] = "Data Saved Successfully";
                }
            }
            catch (Exception ex)
            {
                TempData["DiagnosisMSG"] = "Something went wrong.";
                return(Redirect("/Patient/OPDCharges"));
            }
            TempData["DiagnosisMSG"] = "Data Saved Successfully.";
            return(Redirect("/Patient/OPDCharges"));
        }
示例#2
0
        public ActionResult OPDCharges()
        {
            List <OPDCharge> CategoryList = new List <OPDCharge>();
            Property         p            = new Property();
            DataSet          ds           = new DataSet();

            p.OnTable    = "FetchOPDCharge";
            p.Condition1 = "1";

            ds = dl.FetchOPDCharge_sp(p);

            List <SelectListItem> ChargeTypeinventory = new List <SelectListItem>();

            ChargeTypeinventory.Add(new SelectListItem {
                Text = "Select", Value = ""
            });
            foreach (DataRow dr in ds.Tables[1].Rows)
            {
                ChargeTypeinventory.Add(new SelectListItem {
                    Text = dr["Type"].ToString(), Value = dr["ChargeTypeId"].ToString()
                });
            }
            ViewBag.ChargeTypeinventory = new SelectList(ChargeTypeinventory, "Value", "Text");

            try
            {
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    OPDCharge m = new OPDCharge();

                    m.OPDChargeId    = item["OPDChargeId"].ToString();
                    m.OPDId          = item["OPDId"].ToString();
                    m.PatientId      = item["PatientId"].ToString();
                    m.Date           = item["Date"].ToString();
                    m.Type           = item["Type"].ToString();
                    m.Name           = item["Name"].ToString();
                    m.StandardCharge = item["StandardCharge"].ToString();
                    m.AppliedCharge  = item["AppliedCharge"].ToString();
                    CategoryList.Add(m);
                }
                ViewBag.CategoryList = CategoryList;
            }
            catch (Exception ex)
            {
            }


            OPDCharge info = new RXGOADMIN.Models.OPDCharge();

            try
            {
                info = new RXGOADMIN.Models.OPDCharge()
                {
                    AppliedCharge = ds.Tables[4].Rows[0]["AppliedCharge"].ToString(),
                };
            }
            catch (Exception ex)
            {
            }


            OPDPayment info1 = new RXGOADMIN.Models.OPDPayment();

            try

            {
                info1 = new RXGOADMIN.Models.OPDPayment()
                {
                    Amount = ds.Tables[5].Rows[0]["Amount"].ToString(),
                };
                ViewBag.PaymentInfo = info1;
            }
            catch (Exception ex)
            {
            }



            List <OPDPayment> PaymentList = new List <OPDPayment>();

            p.OnTable = "FetchOPDPayment";
            ds        = dl.FetchOPDPayment_sp(p);
            try
            {
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    OPDPayment m = new OPDPayment();

                    m.PaymentId   = item["PaymentId"].ToString();
                    m.OPDId       = item["OPDId"].ToString();
                    m.PatientId   = item["PatientId"].ToString();
                    m.Date        = item["Date"].ToString();
                    m.Note        = item["Note"].ToString();
                    m.PaymentMode = item["PaymentMode"].ToString();
                    m.Amount      = item["Amount"].ToString();
                    m.Attachment  = item["Attachment"].ToString();
                    PaymentList.Add(m);
                }
                ViewBag.PaymentList = PaymentList;
            }
            catch (Exception ex)
            {
            }

            List <OPDDiagnosis> DiagnosisList = new List <OPDDiagnosis>();

            p.OnTable = "FetchOPDDiagnosis";
            ds        = dl.FetchOPDDiagnosis_sp(p);
            try
            {
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    OPDDiagnosis m = new OPDDiagnosis();

                    m.DiagnosisId = item["DiagnosisId"].ToString();
                    m.OPDId       = item["OPDId"].ToString();
                    m.PatientId   = item["PatientId"].ToString();
                    m.ReportType  = item["ReportType"].ToString();
                    m.ReportDate  = item["ReportDate"].ToString();
                    m.Description = item["Description"].ToString();
                    m.Attachment  = item["Attachment"].ToString();
                    DiagnosisList.Add(m);
                }
                ViewBag.DiagnosisList = DiagnosisList;
            }
            catch (Exception ex)
            {
            }


            return(View(info));
        }