public JsonResult DashBordPatientOPDNew()
        {
            BL_BedStatus   bl_status = new BL_BedStatus();
            string         o         = DateTime.Now.ToString("dd-MM-yyyy");
            SqlDataAdapter ad        = new SqlDataAdapter();

            KeystoneProject.Models.Keystone.DashbordChart obj = new Models.Keystone.DashbordChart();
            Connect();
            // BedStatus bedstatus = new BedStatus();
            DataSet dsstatus = bl_status.GetAllBedStatus();

            DataSet ReportMISPatientWiseCollectionReportOPD = ReportMISPatientWiseCollectionReport(DateTime.Now, DateTime.Now, "OPD");


            obj.OPDCollection = ReportMISPatientWiseCollectionReportOPD.Tables[0].Compute("sum([PaidAmount])", string.Empty).ToString();

            DataSet ReportMISPatientWiseCollectionReportIPD = ReportMISPatientWiseCollectionReport(DateTime.Now, DateTime.Now, "IPD");


            obj.IPDCollection = ReportMISPatientWiseCollectionReportIPD.Tables[0].Compute("sum([PaidAmount])", string.Empty).ToString();
            if (obj.IPDCollection == "")
            {
                obj.IPDCollection = "0";
            }
            if (obj.OPDCollection == "")
            {
                obj.OPDCollection = "0";
            }
            SqlCommand cmd = new SqlCommand("DashBordPatientOPDNew", con);
            DataSet    ds  = new DataSet();

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@HospitalID", HospitalID);
            cmd.Parameters.AddWithValue("@LocationID", HospitalID);
            cmd.Parameters.AddWithValue("@fromDate", DateTime.Now);
            cmd.Parameters.AddWithValue("@ToDate", DateTime.Now);
            ad.SelectCommand = cmd;
            con.Open();
            ad.Fill(ds);
            con.Close();
            obj.OPDRegNew       = ds.Tables[0].Rows.Count.ToString();
            obj.IPDRegNew       = ds.Tables[1].Rows.Count.ToString();
            obj.AppoimentNew    = ds.Tables[2].Rows.Count.ToString();
            obj.IPDDischargeNew = ds.Tables[3].Rows.Count.ToString();
            obj.BedStatus       = dsstatus.Tables[0].Rows.Count.ToString();
            DataView dvItem = new DataView(dsstatus.Tables[0], " RegNO > " + 0 + " and IPDNO > " + 0 + " ", "", DataViewRowState.CurrentRows);

            obj.BedStatusOccupied = dvItem.ToTable().Rows.Count.ToString();
            return(new JsonResult {
                Data = obj, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Beispiel #2
0
 public ActionResult BedStatus(FormCollection collection)
 {
     bedstatus.dsView = bl_status.GetAllBedStatus();
     return(View(bedstatus));
 }