public ActionResult StoreProjectRowsCount(string _USCode) { var resultData = new { ClosureRowsCount = ClosureInfo.Search(o => o.USCode == _USCode).ToList <ClosureInfo>().Count, RenewalRowsCount = RenewalInfo.Search(o => o.USCode == _USCode).ToList <RenewalInfo>().Count, RebuildRowsCount = RebuildInfo.Search(o => o.USCode == _USCode).ToList <RebuildInfo>().Count, MajorLeaseRowsCount = MajorLeaseInfo.Search(o => o.USCode == _USCode).ToList <MajorLeaseInfo>().Count, ReimageRowsCount = ReimageInfo.Search(o => o.USCode == _USCode).ToList <ReimageInfo>().Count, TempClosureRowsCount = TempClosureInfo.Search(o => o.USCode == _USCode).ToList <TempClosureInfo>().Count }; string result = Newtonsoft.Json.JsonConvert.SerializeObject(resultData); return(Content(result)); }
public IHttpActionResult GetReimageApprovers(string flowCode, string projectId = "") { if (string.IsNullOrEmpty(flowCode)) { throw new Exception("flowCode is NULL"); } ReimageInfo reimageInfo = null; if (!string.IsNullOrEmpty(projectId)) { reimageInfo = ReimageInfo.Search(e => e.ProjectId.Equals(projectId)).FirstOrDefault(); } if (reimageInfo == null) { throw new Exception("Could not find the Reimage Info, please check it!"); } var dicUsers = new Dictionary <string, List <SimpleEmployee> >(); switch (flowCode) { case FlowCode.Reimage_Summary: dicUsers.Add("FMs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Finance_Manager)); break; case FlowCode.Reimage_ConsInfo: dicUsers.Add("ConstructionManagers", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Cons_Mgr)); dicUsers.Add("MCCLConsManagers", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.MCCL_Cons_Manager)); break; case FlowCode.Reimage_Package: dicUsers.Add("MarketMgrs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Market_Asset_Mgr)); dicUsers.Add("RegionalMgrs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Regional_Asset_Mgr)); dicUsers.Add("MDDs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Market_DD)); dicUsers.Add("GMs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.GM)); dicUsers.Add("FCs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Finance_Controller)); dicUsers.Add("DOs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.DO)); dicUsers.Add("RDDs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Regional_DD)); dicUsers.Add("VPGMs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.VPGM)); dicUsers.Add("CDOs", Employee.GetEmployeesByRole(RoleCode.CDO)); dicUsers.Add("CFOs", Employee.GetEmployeesByRole(RoleCode.CFO)); dicUsers.Add("MngDirectors", Employee.GetEmployeesByRole(RoleCode.MD)); break; case FlowCode.Reimage_ConsInvtChecking: //dicUsers.Add("FMs", new List<SimpleEmployee>() //{ // new SimpleEmployee() // { // Code = reimageInfo.FinanceAccount, // NameENUS = reimageInfo.FinanceNameENUS, // NameZHCN = reimageInfo.FinanceNameZHCN // } //}); dicUsers.Add("FMs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Finance_Manager)); dicUsers.Add("ConstructionManagers", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Cons_Mgr)); dicUsers.Add("FinanceControllers", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Finance_Controller)); dicUsers.Add("VPGMs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.VPGM)); break; case FlowCode.Reimage_GBMemo: dicUsers.Add("ConstructionManagers", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.Cons_Mgr)); break; } dicUsers.Add("MCCLAssetMgrs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.MCCL_Asset_Mgr)); dicUsers.Add("MCCLAssetDtrs", Employee.GetStoreEmployeesByRole(reimageInfo.USCode, RoleCode.MCCL_Asset_Director)); return(Ok(dicUsers)); }