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; } }
public JsonResult ShowData(string fromDate, string toDate, int actions, int status = 1) { try { MISReports misReportsVM = new MISReports(); misReportsVM.GetUserDetails(); misReportsVM.GetUserActions(); misReportsVM.GetActions(); Actions action = new Actions(); if (Enum.IsDefined(typeof(Actions), actions)) { action = (Actions)actions; } operation = action.ToString(); if (actions == Convert.ToInt32(Actions.Modify) || actions == Convert.ToInt32(Actions.Delete)) { res = (from uaa in misReportsVM.lstUserActions join ua in misReportsVM.lstUserData on uaa.AuthID equals ua.UserID join uc in misReportsVM.lstUserData on uaa.CreatorID equals uc.UserID where uaa.CreatedDate >= Convert.ToDateTime(fromDate) && uaa.CreatedDate <= Convert.ToDateTime(toDate) && uaa.ActionID == actions select new usermngdata { UserName = uaa.UserName, CreatorName = uc.UserName, AuthName = ua.UserName, CreateDate = string.Format("{0:dd/MM/yyyy}", uaa.CreatedDate), ActionName = uaa.ActionID == 2 ? "Modify" : "Delete" }).ToList(); return(Json(res, JsonRequestBehavior.AllowGet)); } else { string statusflag = status == 1 ? "1" : "0"; res = (from a in misReportsVM.lstUserData join ua in misReportsVM.lstUserData on a.AuthID equals ua.UserID join u in misReportsVM.lstUserData on a.CreatorID equals u.UserID where u.CreatedDate >= Convert.ToDateTime(fromDate) && u.CreatedDate <= Convert.ToDateTime(toDate) && a.Active == statusflag select new usermngdata { CreatorName = u.UserName, AuthName = ua.UserName, UserName = u.UserName, CreateDate = string.Format("{0:dd/MM/yyyy}", u.CreatedDate), Status = a.Active == "1" ? "Active" : "InActive", ActionName = "Add" }).ToList(); return(Json(res, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { throw; } }
public JsonResult ShowData(string fromDate, string toDate, string actions, string status) { try { MISReports misReportsVM = new MISReports(); misReportsVM.GetUserDetails(); misReportsVM.GetUserActions(); misReportsVM.GetActions(); operation = actions; if (actions == "Modify" || actions == "Delete") { res = (from a in misReportsVM.lstActions join ua in misReportsVM.lstUserActions on a.ActionID equals ua.ActionID join u in misReportsVM.lstUserData on ua.UserID equals u.UserID join g in misReportsVM.lstUserData on u.AuthID equals g.UserID where u.CreatedDate >= Convert.ToDateTime(fromDate) && u.CreatedDate <= Convert.ToDateTime(toDate) && a.ActionName == actions select new usermngdata { CreatorName = u.UserName, AuthName = g.UserName, UserName = u.UserName, CreateDate = string.Format("{0:dd/MM/yyyy}", u.CreatedDate) }).ToList(); return(Json(res, JsonRequestBehavior.AllowGet)); } else { string statusflag = status == "Active" ? "1" : "0"; res = (from a in misReportsVM.lstActions join ua in misReportsVM.lstUserActions on a.ActionID equals ua.ActionID join u in misReportsVM.lstUserData on ua.UserID equals u.UserID join g in misReportsVM.lstUserData on u.AuthID equals g.UserID where u.CreatedDate >= Convert.ToDateTime(fromDate) && u.CreatedDate <= Convert.ToDateTime(toDate) && a.ActionName == actions && u.Active == statusflag select new usermngdata { CreatorName = u.UserName, AuthName = g.UserName, UserName = u.UserName, CreateDate = string.Format("{0:dd/MM/yyyy}", u.CreatedDate), Status = u.Active == "1" ? "Active" : "InActive" }).ToList(); return(Json(res, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { throw; } }