public ENT.Dashboard GetDashboardData(Guid userid, COM.MyEnumration.Userlevel userlevel) { try { objDashboard = new ENT.Dashboard(); objDashboard = objDalDashboard.GetDashboardData(userid, userlevel); return(objDashboard); } catch (Exception ex) { throw; } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). } objDashboard = null; objDalDashboard = null; // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
// [OutputCache(Duration = 3600, VaryByParam = "none", NoStore = true)] public ActionResult Index() { DashBoardModels objDashBoardModels = new DashBoardModels(); try { if (User.isInRoles("administrator", "apiuser", "masterdistributor", "distributor", "retailer")) { ViewBag.PageHeader = "Dashboard"; objENTDashboard = objBalDashboard.GetDashboardData(Guid.Parse(User.Identity.GetUserId()), User.GetUserlevel()); objDashBoardModels.TotalCustomers = objENTDashboard.TotalCustomers; objDashBoardModels.TotalBalance = objENTDashboard.TotalBalance; objDashBoardModels.TotalTodayRequests = objENTDashboard.TotalTodayRequests; objDashBoardModels.TotalSuccess = objENTDashboard.TotalSuccess; objDashBoardModels.TotalFailed = objENTDashboard.TotalFailed; objDashBoardModels.DMTtotalSuccess = objENTDashboard.DMTtotalSuccess; objDashBoardModels.DMTtotalFailed = objENTDashboard.DMTtotalFailed; objDashBoardModels.DMTinproccess = objENTDashboard.DMTinproccess; objDashBoardModels.WalletRequests = objENTDashboard.WalletRequests; objDashBoardModels.LoginActivity = objENTDashboard.LoginActivity; } } catch (Exception ex) { ViewBag.ErrorMessage = ex.Message; } List <ENT.ServiceMaster> lstService = new List <ENT.ServiceMaster>(); using (BAL.ServiceMaster objBal = new BAL.ServiceMaster()) { lstService = objBal.GetService("30B24352-9F4B-485A-AB18-528E74F6F260"); } List <ENT.CircleMaster> lstCircles = new List <ENT.CircleMaster>(); using (BAL.CircleMaster objBal = new BAL.CircleMaster()) { lstCircles = objBal.GetAllActive("IN"); } ViewBag.ServiceMaster = lstService; ViewBag.CircleMaster = lstCircles; return(View(objDashBoardModels)); }
public ENT.Dashboard GetDashboardData(Guid userid, COM.MyEnumration.Userlevel userlevel) { ENT.Dashboard objDashBoardModels = new ENT.Dashboard(); SqlConnection sqlCon = new SqlConnection(); sqlCon = COM.MySqlConnection.GetConnection.GetDBConnection(); try { SqlCommand cmd = new SqlCommand("GET_DASHBOARD_COUNT", sqlCon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@userlevel", SqlDbType.Int).Value = userlevel; cmd.Parameters.Add("@userid", SqlDbType.UniqueIdentifier).Value = userid; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { objDashBoardModels.TotalCustomers = string.Format("{0:n0}", Convert.ToInt32(dr[0])); objDashBoardModels.TotalBalance = string.Format("{0:n0}", Convert.ToInt32(dr[1])); objDashBoardModels.TotalTodayRequests = string.Format("{0:n0}", Convert.ToInt32(dr[2])); objDashBoardModels.TotalSuccess = string.Format("{0:n0}", Convert.ToInt32(dr[3])); objDashBoardModels.TotalFailed = string.Format("{0:n0}", Convert.ToInt32(dr[4])); objDashBoardModels.DMTtotalSuccess = string.Format("{0:n0}", Convert.ToInt32(dr[5])); objDashBoardModels.DMTtotalFailed = string.Format("{0:n0}", Convert.ToInt32(dr[6])); objDashBoardModels.DMTinproccess = string.Format("{0:n0}", Convert.ToInt32(dr[7])); objDashBoardModels.WalletRequests = string.Format("{0:n0}", Convert.ToInt32(dr[8])); objDashBoardModels.LoginActivity = string.Format("{0:n0}", Convert.ToInt32(dr[9])); } } } catch (Exception ex) { throw; } finally { sqlCon.Close(); } return(objDashBoardModels); }
public JsonResult LoadStatastics() { DashBoardModels objDashBoardModels = new DashBoardModels(); try { objENTDashboard = objBalDashboard.GetDashboardData(Guid.Parse(User.Identity.GetUserId()), User.GetUserlevel()); objDashBoardModels.TotalCustomers = objENTDashboard.TotalCustomers; objDashBoardModels.TotalBalance = objENTDashboard.TotalBalance; objDashBoardModels.TotalTodayRequests = objENTDashboard.TotalTodayRequests; objDashBoardModels.TotalSuccess = objENTDashboard.TotalSuccess; objDashBoardModels.TotalFailed = objENTDashboard.TotalFailed; objDashBoardModels.DMTtotalSuccess = objENTDashboard.DMTtotalSuccess; objDashBoardModels.DMTtotalFailed = objENTDashboard.DMTtotalFailed; objDashBoardModels.DMTinproccess = objENTDashboard.DMTinproccess; objDashBoardModels.WalletRequests = objENTDashboard.WalletRequests; objDashBoardModels.LoginActivity = objENTDashboard.LoginActivity; } catch (Exception ex) { ERRORREPORTING.Report(ex, Request.Url.ToString(), _LoginUserId, _ERRORKEY, string.Empty); } return(Json(objDashBoardModels, JsonRequestBehavior.AllowGet)); }