public int SaveDashboardDetail(DashboardDetail objDash) { connection.Open(); SqlCommand cmd = new SqlCommand("[dbo].[Blog_SaveBlogTempDetail]", connection) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@SocietyName", objDash.SocietyName); cmd.Parameters.AddWithValue("@DateofRegistration", objDash.DateofRegistration); cmd.Parameters.AddWithValue("@RegId", objDash.RegId); cmd.Parameters.AddWithValue("@CommunitySocietyId", objDash.CommunityOfSocietyId); cmd.Parameters.AddWithValue("@KindSocietyId", objDash.KindOfSocietyId); cmd.Parameters.AddWithValue("@IPAddress", objDash.IPAddress); cmd.Parameters.AddWithValue("@BrowserName", objDash.BrowserName); cmd.Parameters.AddWithValue("@LoginID", objDash.Updatedby); var details = cmd.ExecuteNonQuery(); if (details >= 1) { return(1); } connection.Close(); return(0); }
public JsonResult GetDoctorAndPatientChart() { var DoctorAndPatientChart = ""; DashboardDetail GetDashboardCount = new DashboardDetail(); SqlCommand cmdDRAndPat = new SqlCommand("sp_get_CountPatientByDrId", con); cmdDRAndPat.CommandType = CommandType.StoredProcedure; SqlDataAdapter daDRAndPat = new SqlDataAdapter(cmdDRAndPat); DataSet dsDRAndPat = new DataSet(); daDRAndPat.Fill(dsDRAndPat); List <PatientAndDoctorChart> GetPatientAndDoctorChart = new List <PatientAndDoctorChart>(); foreach (DataRow dr in dsDRAndPat.Tables[0].Rows) { GetPatientAndDoctorChart.Add(new PatientAndDoctorChart { DoctorName = Convert.ToString(dr["Name"]), PatientCount = Convert.ToInt32(dr["PatientCount"]), }); } GetDashboardCount.PatientAndDoctorCharts = GetPatientAndDoctorChart; return(Json(GetPatientAndDoctorChart, JsonRequestBehavior.AllowGet)); }
public int SaveAuditDetail(DashboardDetail objAudit) { connection.Open(); SqlCommand cmd = new SqlCommand("[dbo].[Blog_SaveAuditDetail]", connection) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@LastDateAudit", objAudit.LastDateAudit); cmd.Parameters.AddWithValue("@LastDateInspection", objAudit.LastDateInspection); cmd.Parameters.AddWithValue("@AmountAuditFees", objAudit.AmountOfAuditFees); cmd.Parameters.AddWithValue("@SocietyTransID", objAudit.SocietyTransId); cmd.Parameters.AddWithValue("@AreaOfOperation", objAudit.AreaOfOperation); cmd.Parameters.AddWithValue("@GeneralMeetingDate", objAudit.GeneralBodyMeeting); cmd.Parameters.AddWithValue("@IPAddress", objAudit.IPAddress); cmd.Parameters.AddWithValue("@BrowserName", objAudit.BrowserName); cmd.Parameters.AddWithValue("@LoginID", objAudit.Updatedby); var details = cmd.ExecuteNonQuery(); if (details >= 1) { return(1); } connection.Close(); return(0); }
public DashboardDetail GetAuditDetail(string SocietyTransId) { DashboardDetail objGetAudit = new DashboardDetail(); using (SqlConnection con = new SqlConnection(ConStr)) { con.Open(); SqlCommand com = new SqlCommand("[dbo].[Blog_GetAuditDetail]", con) { CommandType = CommandType.StoredProcedure }; com.Parameters.AddWithValue("@SocietyTransID", SocietyTransId); SqlDataReader rdr = com.ExecuteReader(); while (rdr.Read()) { objGetAudit.LastDateAudit = rdr["LastDateAudit"].ToString(); objGetAudit.LastDateInspection = rdr["LastDateInspection"].ToString(); objGetAudit.AmountOfAuditFees = rdr["AmountAuditFees"].ToString(); objGetAudit.SocietyTransId = rdr["SocietyTransID"].ToString(); objGetAudit.AreaOfOperation = rdr["AreaOfOperation"].ToString(); objGetAudit.GeneralBodyMeeting = rdr["GeneralMeetingDate"].ToString(); } return(objGetAudit); } }
public DashboardDetail GetDashBoardData(int UserId) { DashboardDetail objDD = new DashboardDetail(); using (SqlConnection con = new SqlConnection(ConStr)) { con.Open(); SqlCommand com = new SqlCommand("[dbo].[GetDashboardData]", con) { CommandType = CommandType.StoredProcedure }; com.Parameters.AddWithValue("@UserId", UserId); SqlDataReader rdr = com.ExecuteReader(); while (rdr.Read()) { objDD.SocietyName = rdr["SocietyName"].ToString(); objDD.RegId = Convert.ToString(rdr["OldRedgNo"]); objDD.DateofRegistration = Convert.ToDateTime(rdr["CreateDate"].ToString()); objDD.SocietyTransId = rdr["SocietyTransID"].ToString(); objDD.CommunityOfSocietyId = Convert.ToInt32(rdr["CommunityTypeId"]); objDD.KindOfSocietyId = Convert.ToInt32(rdr["KindSocietyTypeId"]); } return(objDD); } }
public ActionResult Dashboard() { if (Convert.ToInt32(Session["BackLogResetStatus"]) == 0) { if (!string.IsNullOrEmpty(Convert.ToString(Session["SocietyTransID"]))) { TempData["Result"] = 1; ViewBag.Err = "First you set your new password, then you will be go further."; return(RedirectToAction("ResetPassword", "BackLog")); } else { return(RedirectToAction("LogIn", "Account")); } } if (TempData["ResetMassageToDashboard"] != null && Convert.ToInt16(TempData["ResetMassageToDashboard"]) == 1) { ViewBag.DashboardMessage = "your security setting has been updated, next time you will login with updated credential."; } try { List <SelectListItem> lstARCSCode = new List <SelectListItem>(); lstARCSCode = GetsubClassSocieties(); ViewBag.lstARCSCode = lstARCSCode; var UserId = Convert.ToInt32(Session["UserId"]); List <SelectListItem> CommunityofSociety = new List <SelectListItem>(); CommunityofSociety = GetCommunityofSociety(); ViewBag.CommunityofSociety = CommunityofSociety; objDD = objBdata.GetDashBoardData(UserId); GetAuditDD = objBdata.GetAuditDetail(objDD.SocietyTransId); string LastDateAudit = GetAuditDD.LastDateAudit; string LastDateInspection = GetAuditDD.LastDateInspection; string GeneralBodyMeeting = GetAuditDD.GeneralBodyMeeting; ViewBag.SocietyName = objDD.SocietyName; ViewBag.RegId = objDD.RegId; ViewBag.DateofRegistration = objDD.DateofRegistration.ToShortDateString(); ViewBag.SocietyTransId = objDD.SocietyTransId; ViewBag.BackLogAreaOfOperation = GetAuditDD.AreaOfOperation; ViewBag.LastDateAudit = LastDateAudit; ViewBag.LastDateInspection = LastDateInspection; ViewBag.GeneralBodyMeeting = GeneralBodyMeeting; ViewBag.AmountOfAuditFees = GetAuditDD.AmountOfAuditFees; ViewBag.CommunityTypeId = objDD.CommunityOfSocietyId; ViewBag.KindSocietyTypeId = objDD.KindOfSocietyId; Session["SocietyTransID"] = objDD.SocietyTransId; } catch (Exception ex) { return(RedirectToAction("LogIn", "Account")); throw ex; } return(View()); }
public JsonResult AddBackLogData(DashboardDetail objMFD) { objMFD.SocietyName = Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment(objMFD.SocietyName); objMFD.RegId = Convert.ToString(Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment(Convert.ToString(objMFD.RegId))); objMFD.DateofRegistration = Convert.ToDateTime(Convert.ToString(objMFD.DateofRegistration.ToShortDateString())); objMFD.CommunityOfSocietyId = Convert.ToInt32(Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment(Convert.ToString(objMFD.CommunityOfSocietyId))); objMFD.KindOfSocietyId = Convert.ToInt32(Microsoft.Security.Application.Sanitizer.GetSafeHtmlFragment(Convert.ToString(objMFD.KindOfSocietyId))); objMFD.IPAddress = GetIPAddress(); objMFD.BrowserName = GetWebBrowserName(); objMFD.Updatedby = Convert.ToInt32(Session["UserId"]); return(Json(objBdata.SaveDashboardDetail(objMFD), JsonRequestBehavior.AllowGet)); }
// SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlCon"].ToString()); // SqlConnection con = new SqlConnection("Data Source=ISMAIL\\SQLEXPRESS;Initial Catalog=HospitalManagement;User Id=sa;Password=123;"); public ActionResult Index() { SqlCommand cmd = new SqlCommand("sp_get_Dashboard_Detail", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); DashboardDetail GetDashboardCount = new DashboardDetail(); if (TempData["CurrentPatient"] == null) { GetDashboardCount.CountExistingPatient = Convert.ToInt32(ds.Tables[0].Rows[0]["CurrentPatient"]); } else { GetDashboardCount.CountExistingPatient = Convert.ToInt32(TempData["CurrentPatient"]); } if (TempData["CurrentCountAppointment"] == null) { ViewBag.CountCurrentAppointment = Convert.ToInt32(ds.Tables[1].Rows[0]["Appointment"]); } else { ViewBag.CountCurrentAppointment = Convert.ToInt32(TempData["CurrentCountAppointment"]); } if (TempData["TotalEarning"] == null) { object value = ds.Tables[2].Rows[0]["TotalEarning"]; if (value != DBNull.Value) { GetDashboardCount.SumEarningPerday = Convert.ToSingle(ds.Tables[2].Rows[0]["TotalEarning"]); } else { GetDashboardCount.SumEarningPerday = Convert.ToSingle("0.00"); } } else { GetDashboardCount.SumEarningPerday = Convert.ToSingle(TempData["TotalEarning"]); } return(View(GetDashboardCount)); }
public JsonResult Index1() { SqlCommand cmd = new SqlCommand("sp_get_Dashboard_Detail", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); DashboardDetail GetDashboardCount = new DashboardDetail(); GetDashboardCount.CountCurrentAppointment = Convert.ToInt32(ds.Tables[1].Rows[0]["Appointment"]); GetDashboardCount.CountExistingPatient = Convert.ToInt32(ds.Tables[0].Rows[0]["CurrentPatient"]); ViewBag.CountCurrentAppointment = Convert.ToInt32(ds.Tables[1].Rows[0]["Appointment"]); GetDashboardCount.SumEarningPerday = Convert.ToInt32(ds.Tables[2].Rows[0]["TotalEarning"]); return(Json(GetDashboardCount, JsonRequestBehavior.AllowGet)); }
public ActionResult GetCountAppointmentByDRId(DateTime fromappDate, DateTime toappDate, int?doctorId) { SqlCommand cmd = new SqlCommand("sp_get_Dashboard_GetCountAppointmentByDRId", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@fromdate", fromappDate.ToShortDateString()); cmd.Parameters.AddWithValue("@todate", toappDate.ToShortDateString()); cmd.Parameters.AddWithValue("@Drid", doctorId); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); DashboardDetail GetDashboardCount = new DashboardDetail(); GetDashboardCount.CountCurrentAppointment = Convert.ToInt32(ds.Tables[0].Rows[0]["Appointment"]); return(View()); }
public ActionResult DetailView() { int cid = Int32.Parse(Request["cid"]); if (Request["commentfield"] != null) { using (SqlConnection conection = new SqlConnection(connectionString)) { SqlCommand cmd2 = new SqlCommand(); cmd2.CommandText = "INSERT INTO [dbo].[Comment] (Post_id, Comment, Createon) VALUES ('" + cid + "', '" + Request["commentfield"] + "' ,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')"; cmd2.Connection = conection; conection.Open(); cmd2.ExecuteNonQuery(); conection.Close(); } } SqlConnection con = new SqlConnection(); con.ConnectionString = connectionString; SqlCommand cmd = new SqlCommand(); SqlDataReader reader; DashboardDetail detailView = new DashboardDetail(); cmd.CommandText = "SELECT [Id], [Title], [Description], [Content], [Createon] FROM [dbo].[Post] WHERE [Id] = " + cid; cmd.Connection = con; con.Open(); reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { detailView.Id = reader.GetInt32(0); detailView.Title = reader.GetString(1); detailView.Description = reader.GetString(2); detailView.Content = reader.GetString(3); detailView.CreatedOn = reader.GetDateTime(4); } } con.Close(); cmd.CommandText = "SELECT [Comment] FROM [dbo].[Comment] WHERE [Post_id] = " + cid; con.Open(); reader = cmd.ExecuteReader(); List <string> commentList = new List <string>(); if (reader.HasRows) { while (reader.Read()) { commentList.Add(reader.GetString(0)); } } else { commentList.Add("Keine Kommentare vorhanden"); } detailView.CommentList = commentList; return(View(detailView)); }
public JsonResult GetStockEntryTotalAmountChartData(int[] ProductId, int Duration = 30) { DashboardDetail _details = new DashboardDetail(); return(Json(_details.GetStockEntryTotalAmountChartData(ProductId, Duration), JsonRequestBehavior.AllowGet)); }
public JsonResult ExitingPatientChanngeinfo(DoctorNameSpeciality drobj) { HospitalManagementEntities db = new Models.HospitalManagementEntities(); DoctorNameSpeciality obj = new DoctorNameSpeciality(); string fromdate = string.Empty; string todate = string.Empty; string Drname = string.Empty; string flagExitPatient = string.Empty; fromdate = Convert.ToString(drobj.fromDate); todate = Convert.ToString(drobj.toDate); Drname = Convert.ToString(drobj.NameSpecialist); flagExitPatient = Convert.ToString(drobj.flag); SqlCommand cmd = new SqlCommand("[sp_getExistingPatientsByDrId]", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); //Existing Patient Logic when only drname is passed if ((Drname != string.Empty) && (fromdate == string.Empty) && (todate == string.Empty) && flagExitPatient == "ExistingPatient") { SqlCommand cmdOnlyDrName = new SqlCommand("[sp_getExistingPatientsByDrId]", con); obj.NameSpecialist = Drname.ToString(); con.Open(); string name = obj.NameSpecialist.Split('-')[0]; string specialist = obj.NameSpecialist.Split('-')[1]; obj.DrId = Convert.ToInt32(db.Doctors.Where(s => s.Name == name && s.Specialist == specialist).Select(s => s.DoctorId).FirstOrDefault()); cmdOnlyDrName.CommandType = CommandType.StoredProcedure; cmdOnlyDrName.Parameters.AddWithValue("@DrId", obj.DrId); cmdOnlyDrName.Parameters.AddWithValue("@fromdate", obj.fromDate); cmdOnlyDrName.Parameters.AddWithValue("@todate", obj.toDate); SqlDataAdapter daOnlyDrName = new SqlDataAdapter(cmdOnlyDrName); DataSet dsOnlyDrName = new DataSet(); daOnlyDrName.Fill(dsOnlyDrName); int ExistingCountPatient = Convert.ToInt32(dsOnlyDrName.Tables[0].Rows[0]["CurrentPatient"]); TempData["CurrentPatient"] = ExistingCountPatient; } //Passed only from and todate else if ((Drname == string.Empty) && (fromdate != string.Empty) && (todate != string.Empty) && flagExitPatient == "ExistingPatient") { SqlCommand cmdfromToDate = new SqlCommand("[sp_getExistingPatientsByDrId]", con); obj.NameSpecialist = Drname.ToString(); con.Open(); string name = obj.NameSpecialist.Split('-')[0]; string specialist = obj.NameSpecialist.Split('-')[1]; obj.DrId = Convert.ToInt32(db.Doctors.Where(s => s.Name == name && s.Specialist == specialist).Select(s => s.DoctorId).FirstOrDefault()); cmdfromToDate.CommandType = CommandType.StoredProcedure; cmdfromToDate.Parameters.AddWithValue("@DrId", obj.DrId); cmdfromToDate.Parameters.AddWithValue("@fromdate", obj.fromDate); cmdfromToDate.Parameters.AddWithValue("@todate", obj.toDate); SqlDataAdapter dafromToDate = new SqlDataAdapter(cmd); DataSet dsfromToDate = new DataSet(); dafromToDate.Fill(dsfromToDate); int ExistingCountPatient = Convert.ToInt32(dsfromToDate.Tables[0].Rows[0]["CurrentPatient"]); TempData["CurrentPatient"] = ExistingCountPatient; } //Passed all the Values else if ((Drname != string.Empty) && (fromdate != string.Empty) && (todate != string.Empty) && flagExitPatient == "ExistingPatient") { SqlCommand cmdAllValues = new SqlCommand("[sp_getExistingPatientsByDrId]", con); obj.NameSpecialist = Drname.ToString(); con.Open(); string name = obj.NameSpecialist.Split('-')[0]; string specialist = obj.NameSpecialist.Split('-')[1]; obj.DrId = Convert.ToInt32(db.Doctors.Where(s => s.Name == name && s.Specialist == specialist).Select(s => s.DoctorId).FirstOrDefault()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@DrId", obj.DrId); cmd.Parameters.AddWithValue("@fromdate", obj.fromDate); cmd.Parameters.AddWithValue("@todate", obj.toDate); SqlDataAdapter daAllValues = new SqlDataAdapter(cmd); DataSet dsAllValues = new DataSet(); daAllValues.Fill(dsAllValues); int ExistingCountPatient = Convert.ToInt32(dsAllValues.Tables[0].Rows[0]["CurrentPatient"]); TempData["CurrentPatient"] = ExistingCountPatient; } DashboardDetail GetDashboardCount = new DashboardDetail(); GetDashboardCount.CountExistingPatient = (int)TempData["CurrentPatient"]; // ViewBag.CountExistingPatient = (int)TempData["CurrentPatient"] return(Json(GetDashboardCount, JsonRequestBehavior.AllowGet)); }
public JsonResult GetTotalCustomerTypePieChartData(int[] CustTypeId, int Duration = 30) { DashboardDetail _details = new DashboardDetail(); return(Json(_details.GetTotalCustomerTypeChartData(CustTypeId, Duration), JsonRequestBehavior.AllowGet)); }