Ejemplo n.º 1
0
        public JsonResult ChangeData(string regionId, string applicationId)
        {
            try
            {
                MISReports misReportsViewModel = new MISReports();
                misReportsViewModel.GetApplicationRegionDetails();
                misReportsViewModel.GetAllDetails();

                result = (from g in misReportsViewModel.lstClients
                          join h in misReportsViewModel.lstProjects on g.ClientID equals h.ClientId
                          join i in misReportsViewModel.lstApplication on h.ProjectID equals i.ProjectId
                          join j in misReportsViewModel.lstAppVersion on i.AppVersion equals j.Id
                          join bp in misReportsViewModel.BankTypeList on i.BankType equals bp.Value
                          join k in misReportsViewModel.lstRegion on h.RegionId equals k.Id
                          where i.ApplicationName == applicationId && k.Region == regionId
                          select new clientInfo
                {
                    ClientName = g.ClientName,
                    ProjectName = h.ProjectName,
                    ApplicationName = i.ApplicationName,
                    AppVersion = j.AppVersion,
                    BankTypeName = bp.Key,
                    RegionName = k.Region
                }).ToList();

                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public ActionResult Index()//string actionName
        {
            try
            {
                string urlPart = @"/Client";
                if (System.Web.HttpContext.Current.Request.UrlReferrer.ToString().IndexOf(urlPart) > 0)
                {
                    Session["PreviousURL"] = System.Web.HttpContext.Current.Request.UrlReferrer;
                }

                operation         = "";
                selectdValueCopy  = "";
                byRegionCopy      = "";
                byApplicationCopy = "";
                //actionName1 = actionName;

                misReportsViewModel.GetUserDetails();
                misReportsViewModel.GetUserActions();
                misReportsViewModel.GetActions();

                misReportsViewModel.GetApplicationRegionDetails();
                misReportsViewModel.GetAllDetails();

                //var Actionlist = new SelectList(new[]
                //{
                //    new { ID = "1", Name = "Active" },
                //    new { ID = "0", Name = "Inactive" },
                //},
                //    "ID", "Name", 1);

                //ViewData["list"] = Actionlist;

                //User Management

                misreportsList = ((IEnumerable <MISReports>) from u in misReportsViewModel.lstUserData
                                  join e in misReportsViewModel.lstUserData on u.CreatorID equals e.UserID
                                  join g in misReportsViewModel.lstUserData on u.AuthID equals g.UserID
                                  where u.Active == "1"
                                  select new MISReports
                {
                    CreatorName = e.UserName,
                    AuthName = g.UserName,
                    UserName = u.UserName,
                    CreateDate = u.CreatedDate,
                    Status = Convert.ToBoolean(Convert.ToInt32(u.Active))
                }).ToList();

                dt = usermngdata.ToDataTable(misreportsList.Select(x => new usermngdata
                {
                    UserName    = x.UserName,
                    AuthName    = x.AuthName,
                    CreatorName = x.CreatorName,
                    CreateDate  = string.Format("{0:dd/MM/yyyy}", x.CreateDate),
                    Status      = x.Status.ToString() == "True" ? "Active" : "InActive",
                    ActionName  = "Add"
                }).ToList());

                ViewData["misReportsViewModel2"] = misreportsList;

                //Client Information
                misreportsList1 = ((IEnumerable <MISReports>) from g in misReportsViewModel.lstClients
                                   join h in misReportsViewModel.lstProjects on g.ClientID equals h.ClientId
                                   join i in misReportsViewModel.lstApplication on h.ProjectID equals i.ProjectId
                                   join j in misReportsViewModel.lstAppVersion on i.AppVersion equals j.Id
                                   join bp in misReportsViewModel.BankTypeList on i.BankType equals bp.Value
                                   join k in misReportsViewModel.lstRegion on h.RegionId equals k.Id
                                   select new MISReports
                {
                    ClientName = g.ClientName,
                    projectName = h.ProjectName,
                    ApplicationName = i.ApplicationName,
                    appVersion = j.AppVersion,
                    BankTypeName = bp.Key,
                    RegionName = k.Region
                }).ToList();

                dt1 = usermngdata.ToDataTable(misreportsList1.Select(x => new clientInfo
                {
                    ClientName      = x.ClientName,
                    ProjectName     = x.projectName,
                    ApplicationName = x.ApplicationName,
                    AppVersion      = x.appVersion,
                    BankTypeName    = x.BankTypeName,
                    RegionName      = x.RegionName
                }).ToList());

                ViewData["misReportsViewModel1"] = misreportsList1;

                misReportsViewModel.RegionList = misReportsViewModel.lstRegion.Select(m => m.Region).Distinct().Select(i => new SelectListItem()
                {
                    Text  = i.ToString(),
                    Value = i
                }).ToList();

                ViewBag.applicationids = misReportsViewModel.lstApplication.Where(x => x.ApplicationID == 0).Select(m => m.ApplicationName).Distinct().Select(i => new SelectListItem()
                {
                    Text  = i.ToString(),
                    Value = i
                });


                return(View(misReportsViewModel));
            }
            catch (Exception ex)
            {
                throw;
            }
        }