private void LoadRelatedConciergeList(ManageProspectsViewModel manageProspectViewModel, UserAccount user, BasicLoanData loan, Guid loanId, int?contactId = null, Boolean?isLoa = null) { Guid companyId = Guid.Empty; int channelId = 0; int divisionId = 0; if (manageProspectViewModel.CompanyId != null && manageProspectViewModel.CompanyId != "-1" && manageProspectViewModel.CompanyId != "0") { companyId = Guid.Parse(manageProspectViewModel.CompanyId); } if (manageProspectViewModel.ChannelId > 0) { channelId = manageProspectViewModel.ChannelId; } if (manageProspectViewModel.DivisionId > 0) { divisionId = manageProspectViewModel.DivisionId; } var conciergeList = !WebCommonHelper.LicensingEnabled() ? UserAccountServiceFacade.RetrieveConciergeInfo(null, null, null, null, companyId, channelId, divisionId, manageProspectViewModel.BranchId) : UserAccountServiceFacade.RetrieveConciergeInfo(loanId, manageProspectViewModel.ProspectId, isLoa, user.UserAccountId, companyId, channelId, divisionId, manageProspectViewModel.BranchId); if (conciergeList != null) { conciergeList.Insert(0, new ConciergeInfo() { NMLSNumber = "", ConciergeName = "Select One", UserAccountId = 0 }); } manageProspectViewModel.ConciergeInfoList = conciergeList; }
public ActionResult Create() { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "FManage_Create"); List <FunctionTypeVM> entityList_VM = new List <FunctionTypeVM>(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entityList_VM = funTypeMgtHelper.Value.GetAllFunType(entity_WCFAuthInfoVM); }); FunctionVM entity_Function = new FunctionVM(); if (entityList_VM != null && entityList_VM.Count() > 0) { foreach (var item in entityList_VM) { entity_Function.SelectedTypeList.Add(new FunctionSelectedType() { ID = item.ID, FunctionType = item.FunctionType, Selected = false }); } } return(View(entity_Function)); }
private void CreateStaticPage(long houseId) { HouseIndexViewModel houseIndexView = null; HouseDTO house = HouseService.GetById(houseId); if (house == null) { return; } var housePics = HousePicService.GetPics(houseId); var attachments = AttachmentService.GetAttachment(houseId); houseIndexView = new HouseIndexViewModel { House = house, HousePics = housePics, Attachments = attachments }; this.ControllerContext.Controller.ViewData.Model = houseIndexView; string html = WebCommonHelper.RendViewToString( this.ControllerContext, "~/views/House/StaticIndex.cshtml", ""); System.IO.File.AppendAllText(String.Format(@"D:\PersonalWorkSpace\github\ZSZ\ZSZ.FrontWeb\{0}.html", houseId), html); }
public ActionResult Delete(FormCollection collection) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "AuthorizedHistoryManage_Delete"); string str_ID = collection["ID"]; string str_ErrorMsg = ""; CommonJsonResult commonJsonResult = new CommonJsonResult(); commonJsonResult.MsgTitle = str_MsgBoxTitle; WCFReturnResult ret = new WCFReturnResult(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { ret = authHisMgtHelper.Value.Delete(entity_WCFAuthInfoVM, str_ID); }); if (ret != null && ret.IsSuccess) { commonJsonResult.ReturnUrl = Url.Action("Index", "AuthorizedHistoryManage", new { Area = "AccessControl" }, Request.Url.Scheme); commonJsonResult.Success = true; MsgInfo successMsgInfo = new MsgInfo(); successMsgInfo.MsgTitle = str_MsgBoxTitle; successMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "I001"); successMsgInfo.MsgType = MessageType.Success; TempData[ActionMessageKey] = successMsgInfo; return(Json(commonJsonResult)); } else { if (ret.StrList_Error.Count > 0) { str_ErrorMsg = string.Join("<br/>", ret.StrList_Error.ToArray()); commonJsonResult.ReturnUrl = Url.Action("Index", "AuthorizedHistoryManage", new { Area = "AccessControl" }, Request.Url.Scheme); commonJsonResult.Success = false; MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = str_ErrorMsg; errorMsgInfo.MsgType = MessageType.ValidationError; TempData[ActionMessageKey] = errorMsgInfo; return(Json(commonJsonResult)); } else { commonJsonResult.ReturnUrl = Url.Action("Index", "AuthorizedHistoryManage", new { Area = "AccessControl" }, Request.Url.Scheme); commonJsonResult.Success = false; MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "E006"); errorMsgInfo.MsgType = MessageType.ValidationError; TempData[ActionMessageKey] = errorMsgInfo; return(Json(commonJsonResult)); } } }
public ActionResult Edit(LUserRoleVM entity_VM) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LURoleManage_Edit"); initFunsList(); ModelState.Clear(); TryValidateModel(entity_VM); if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag)) { return(View(entity_VM)); } string strError = ""; if (!string.IsNullOrWhiteSpace(entity_VM.funDListJson)) { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); entity_VM.EntityList_FDInfo = javaScriptSerializer.Deserialize <List <FunDetailInfo> >(entity_VM.funDListJson); } WCFReturnResult entity_Return = new WCFReturnResult(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_Return = roleMgtHelper.Value.Update(entity_WCFAuthInfoVM, entity_VM); }); if (entity_Return != null && entity_Return.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray()); } if (entity_Return != null && entity_Return.IsSuccess) { webCommonHelper.RefreshSeverSideSession(this, this.HttpContext, postOffice.LoginUserMgtSerPath); MsgInfo successMsgInfo = new MsgInfo(); successMsgInfo.MsgTitle = str_MsgBoxTitle; successMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "I000"); successMsgInfo.MsgType = MessageType.Success; TempData[ActionMessageKey] = successMsgInfo; return(RedirectToAction("Index")); } else { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; return(View(entity_VM)); } }
// GET: AccessControl/LoginUserManage/Index public ActionResult Index(int page = 1, string sort = "", string sortDir = "") { //Retrieve selection criteria from cache. LoginUserVM selectionCriteria = new LoginUserVM(); //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LoginUserManage"); GetSelectionCriteriaFromViewData(ref selectionCriteria); //Define output variable(recordCount && entityList_Result) int recordCount = 0; List <LoginUserVM> entityList_Result = new List <LoginUserVM>(); //Define wcf output object; LUSerListResult entity_LUSerListResult = null; //Instantiate WebCommonHelper in order to call wcf service WebCommonHelper webCommonHelper = new WebCommonHelper(); //webCommonHelper.CallWCFHelper<ILoginUserMgtSer>(this, this.HttpContext, postOffice.LoginUserMgtSerPath, (entity_ILoginUserMgtSer, entity_WCFAuthInfoVM) => //{ // entity_LUSerListResult = entity_ILoginUserMgtSer.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, page, PageSize, sort, sortDir, CustomFilter(selectionCriteria), guidList_AccessedLUserID); //}); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_LUSerListResult = loginUserMgtHelper.Value.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, page, PageSize, sort, sortDir, CustomFilter(selectionCriteria), guidList_AccessedLUserID); }); if (entity_LUSerListResult != null) { recordCount = entity_LUSerListResult.Int_TotalRecordCount; entityList_Result = entity_LUSerListResult.EntityList_LoginUserVM; } //Set paging bar info (Total Record Count and Page Index) StorePageInfo(recordCount, page); //Cache selection criteria StoreSelectionCriteria <LoginUserVM>(null); string strError = ""; if (entity_LUSerListResult.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_LUSerListResult.StrList_Error.ToArray()); } if (entity_LUSerListResult.StrList_Error.Count > 0) { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; } return(View(entityList_Result)); }
public void CreateOrgDetails() { orgDetailsMgtController.FunTypeKey = "Create"; commonFixture.MockControllerInfo(orgDetailsMgtController, "http://localhost:50653/AccessControl/LUOrgDetailsManage/Create"); Random random = new Random(); #region [ Create Organization Details with Specific Functions ] //00010001 FunctionVM entity_FunctionVM = entityList_FunVM.Where(current => current.FunctionPath == "00010001").FirstOrDefault(); string str_FunID = entity_FunctionVM.ID.ToString(); FunDetailInfo entity_FunDetailInfo = new FunDetailInfo(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(orgDetailsMgtController, (entity_WCFAuthInfoVM) => { entity_FunDetailInfo = orgDetailsMgtController.funMgtHelper.Value.GetFunDetailInfo_FID(entity_WCFAuthInfoVM, str_FunID); entity_FunDetailInfo.FDSelected.ForEach(current => current = true); }); JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); List <FunDetailInfo> entityList_FunDetailInfo = new List <FunDetailInfo>(); entityList_FunDetailInfo.Add(entity_FunDetailInfo); int r = random.Next(1, 1000); string str_OrgDetailsKey = "Test" + r; //User Role LUserOrgDetailsVM orgDetailsVM = new LUserOrgDetailsVM() { OrgDetailsKey = str_OrgDetailsKey, OrgDetailsType = 1, funDListJson = javaScriptSerializer.Serialize(entityList_FunDetailInfo) }; ActionResult actionResult = orgDetailsMgtController.Create(orgDetailsVM); Assert.IsType <RedirectToRouteResult>(actionResult); #endregion #region [ Create Organization Details with Role ] r = random.Next(1, 1000); str_OrgDetailsKey = "Test" + r; orgDetailsVM = new LUserOrgDetailsVM() { OrgDetailsKey = str_OrgDetailsKey, OrgDetailsType = 2, roleListIDList = String.Join("|", entityList_RoleVM.Select(current => current.ID.ToString()).ToArray()) }; actionResult = orgDetailsMgtController.Create(orgDetailsVM); Assert.IsType <RedirectToRouteResult>(actionResult); #endregion }
/// <summary> /// 获取图片验证码 /// </summary> /// <returns></returns> public ActionResult GetVerifyCode() { string verifyCode = WebCommonHelper.CreateVerifyCode(5); TempData["verifyCodeFront"] = verifyCode; MemoryStream ms = ImageFactory.GenerateImage(verifyCode, 51, 100, 20, 6); return(File(ms, "image/jpeg")); }
public ActionResult Edit(string ID) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LURoleManage_Edit"); initFunsList(); string strError = ""; RoleSerEditResult wcf_Return = new RoleSerEditResult(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { wcf_Return = roleMgtHelper.Value.GetEntityByID(entity_WCFAuthInfoVM, ID); }); if (wcf_Return.StrList_Error.Count > 0 || wcf_Return.Entity_LUserRoleVM == null) { if (wcf_Return.StrList_Error.Count() > 0) { strError = string.Join("<br/>", wcf_Return.StrList_Error.ToArray()); } MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; LUserRoleVM selectionCriteria = new LUserRoleVM(); if (TempData.ContainsKey(SelectionCriteriaKey)) { selectionCriteria = (LUserRoleVM)TempData[SelectionCriteriaKey]; } TempData[SelectionCriteriaKey] = selectionCriteria; TempData[ActionMessageKey] = errorMsgInfo; return(RedirectToAction("Index")); } else { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { List <FunDetailInfo> entityList_FunDetailInfo = orgDetailMgtHelper.Value.GetPrivilegeByUserID(entity_WCFAuthInfoVM, ID, RoleType.Role); wcf_Return.Entity_LUserRoleVM.EntityList_FDInfo = entityList_FunDetailInfo; wcf_Return.Entity_LUserRoleVM.funDListJson = javaScriptSerializer.Serialize(entityList_FunDetailInfo); }); } return(View(wcf_Return.Entity_LUserRoleVM)); }
// GET: AccessControl/FTMange public ActionResult Index(int page = 1, string sort = "", string sortDir = "") { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "FTManage"); //Define output variable(recordCount && entityList_Result) int recordCount = 0; List <FunctionTypeVM> entityList_Result = new List <FunctionTypeVM>(); //Define wcf output object; FTSerListResult entity_FTSerListResult = null; FunctionTypeVM selectionCriteria = new FunctionTypeVM(); //Retrieve selection criteria that cached by system GetSelectionCriteriaFromViewData(ref selectionCriteria); //Instantiate WebCommonHelper in order to call wcf service WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_FTSerListResult = funTypeMgtHelper.Value.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, page, PageSize, sort, sortDir, CustomFilter(selectionCriteria)); }); //Assign data to local variable if (entity_FTSerListResult != null) { recordCount = entity_FTSerListResult.Int_TotalRecordCount; entityList_Result = entity_FTSerListResult.EntityList_FunctionTypeVM; } //Set paging bar info (Total Record Count and Page Index) StorePageInfo(recordCount, page); //Cache selection criteria StoreSelectionCriteria <FunctionVM>(null); //Pass Error To UI string strError = ""; if (entity_FTSerListResult.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_FTSerListResult.StrList_Error.ToArray()); } if (entity_FTSerListResult.StrList_Error.Count > 0) { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; } return(View(entityList_Result)); }
public ActionResult Create(LUserOrgDetailsVM orgDetailsVM) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrgDetailsManage_Create"); initOrgDetailsList(); ModelState.Clear(); TryValidateModel(orgDetailsVM); if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag)) { return(View(orgDetailsVM)); } string strError = ""; if (!string.IsNullOrWhiteSpace(orgDetailsVM.funDListJson) && (orgDetailsVM.OrgDetailsType.HasValue && orgDetailsVM.OrgDetailsType.Value == 1)) { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); orgDetailsVM.EntityList_FDInfo = javaScriptSerializer.Deserialize <List <FunDetailInfo> >(orgDetailsVM.funDListJson); } WCFReturnResult ret = new WCFReturnResult(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { ret = orgDetailMgtHelper.Value.Create(entity_WCFAuthInfoVM, orgDetailsVM); }); if (ret != null && ret.StrList_Error.Count() > 0) { strError = string.Join("<br/>", ret.StrList_Error.ToArray()); } if (ret != null && ret.IsSuccess) { MsgInfo successMsgInfo = new MsgInfo(); successMsgInfo.MsgTitle = str_MsgBoxTitle; successMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "I000"); successMsgInfo.MsgType = MessageType.Success; TempData[ActionMessageKey] = successMsgInfo; return(RedirectToAction("Index")); } else { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; return(View(orgDetailsVM)); } }
public ActionResult Edit(string UserID) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LoginUserManage_Edit"); //Retrieve Drop Down List Item RetrieveDropDownListInfo(); LUSerEditResult wcf_Return = new LUSerEditResult(); WebCommonHelper webCommonHelper = new WebCommonHelper(); //webCommonHelper.CallWCFHelper<ILoginUserMgtSer>(this, this.HttpContext, postOffice.LoginUserMgtSerPath, (entity_ILoginUserMgtSer, entity_WCFAuthInfoVM) => //{ // wcf_Return = entity_ILoginUserMgtSer.GetEntityByIDWDetails(entity_WCFAuthInfoVM, UserID); //}); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { wcf_Return = loginUserMgtHelper.Value.GetEntityByIDWDetails(entity_WCFAuthInfoVM, UserID); }); if (wcf_Return.StrList_Error.Count > 0 || wcf_Return.Entity_LoginUserVM == null) { string strError = ""; if (wcf_Return.StrList_Error.Count() > 0) { strError = string.Join("<br/>", wcf_Return.StrList_Error.ToArray()); } MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; LoginUserVM selectionCriteria = new LoginUserVM(); if (TempData.ContainsKey(SelectionCriteriaKey)) { selectionCriteria = (LoginUserVM)TempData[SelectionCriteriaKey]; } TempData[SelectionCriteriaKey] = selectionCriteria; TempData[ActionMessageKey] = errorMsgInfo; return(RedirectToAction("Index")); } else { if (wcf_Return.Entity_LoginUserVM.EntityList_FDInfo.Count > 0) { JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer(); wcf_Return.Entity_LoginUserVM.funDListJson = javaScriptSerializer.Serialize(wcf_Return.Entity_LoginUserVM.EntityList_FDInfo); } return(View(wcf_Return.Entity_LoginUserVM)); } }
public ActionResult Index(AuditLogVM selectionCriteria) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "AuditLogManage"); //Define output variable(recordCount && entityList_Result) int recordCount = 0; List <AuditLogVM> entityList_Result = new List <AuditLogVM>(); //Define wcf output object; ALSerListResult entity_ALSerListResult = null; WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_ALSerListResult = auditLogMgtHelper.Value.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, 1, PageSize, null, null, CustomFilter(selectionCriteria)); }); //webCommonHelper.CallWCFHelper<IAuditLogMgtSer>(this, this.HttpContext, postOffice.AuditLogMgtSerPath, (entity_IAuditLogMgtSer, entity_WCFAuthInfoVM) => //{ // entity_ALSerListResult = entity_IAuditLogMgtSer.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, 1, PageSize, null, null, CustomFilter(selectionCriteria)); //}); //Assign data to local variable if (entity_ALSerListResult != null) { recordCount = entity_ALSerListResult.Int_TotalRecordCount; entityList_Result = entity_ALSerListResult.EntityList_AuditLogVM; } StorePageInfo(recordCount, 1); StoreSelectionCriteria <AuditLogVM>(selectionCriteria); initFunType(); //Pass Error To UI string strError = ""; if (entity_ALSerListResult.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_ALSerListResult.StrList_Error.ToArray()); } if (entity_ALSerListResult.StrList_Error.Count > 0) { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; } return(View(entityList_Result)); }
public ActionResult Create() { WebCommonHelper webCommonHelper = new WebCommonHelper(); List <LUserOrgDetailsVM> entityList_OrgDetailsVM = initOrgDetailsList(); ViewBag.OrgDList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true); return(View(new LUserOrganizationVM())); }
public ActionResult Edit(SystemInfoVM entity_VM) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "SystemInfoManage"); ModelState.Clear(); TryValidateModel(entity_VM); if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag)) { return(View(entity_VM)); } string strError = ""; WCFReturnResult entity_Return = new WCFReturnResult(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_Return = systemMgtHelper.Value.Update(entity_WCFAuthInfoVM, entity_VM); }); if (entity_Return != null && entity_Return.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray()); } if (entity_Return != null && entity_Return.IsSuccess) { webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { //Update the static content StaticContent.SystemInfoInst = systemMgtHelper.Value.GetSystemInfo(entity_WCFAuthInfoVM); }); MsgInfo successMsgInfo = new MsgInfo(); successMsgInfo.MsgTitle = str_MsgBoxTitle; successMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "I000"); successMsgInfo.MsgType = MessageType.Success; TempData[ActionMessageKey] = successMsgInfo; return(RedirectToAction("Index")); } else { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; return(View("Index", entity_VM)); } }
public List <LUserOrgDetailsVM> initOrgDetailsList() { List <LUserOrgDetailsVM> entityList_OrgDetailsVM = new List <LUserOrgDetailsVM>(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entityList_OrgDetailsVM = orgDetailMgtHelper.Value.GetAll(entity_WCFAuthInfoVM); }); return(entityList_OrgDetailsVM); }
// GET: AccessControl/LUOrganizationManage public ActionResult Index(int page = 1, string sort = "", string sortDir = "") { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrganizationManage"); //Define output variable(recordCount && entityList_Result) int recordCount = 0; LUserOrganizationVM selectionCriteria = new LUserOrganizationVM(); GetSelectionCriteriaFromViewData(ref selectionCriteria); List <LUserOrganizationVM> entityList_Result = new List <LUserOrganizationVM>(); //Define wcf output object; OrgSerListResult entity_OrgSerListResult = null; WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_OrgSerListResult = orgMgtHelper.Value.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, page, PageSize, sort, sortDir, CustomFilter(selectionCriteria)); }); //Assign data to local variable if (entity_OrgSerListResult != null) { recordCount = entity_OrgSerListResult.Int_TotalRecordCount; entityList_Result = entity_OrgSerListResult.EntityList_LUserOrganizationVM; } StorePageInfo(recordCount, page); StoreSelectionCriteria <FunctionVM>(null); //Pass Error To UI string strError = ""; if (entity_OrgSerListResult != null && entity_OrgSerListResult.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_OrgSerListResult.StrList_Error.ToArray()); } if (!string.IsNullOrWhiteSpace(strError)) { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; } return(View(entityList_Result)); }
public ActionResult Create(LUserOrganizationVM orgVM) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrganizationManage_Create"); WebCommonHelper webCommonHelper = new WebCommonHelper(); List <LUserOrgDetailsVM> entityList_OrgDetailsVM = initOrgDetailsList(); ViewBag.OrgDList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true); ModelState.Clear(); TryValidateModel(orgVM); if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag)) { return(View(orgVM)); } string strError = ""; //Define wcf output object; WCFReturnResult ret = new WCFReturnResult(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { ret = orgMgtHelper.Value.Create(entity_WCFAuthInfoVM, orgVM); }); if (ret != null && ret.StrList_Error.Count() > 0) { strError = string.Join("<br/>", ret.StrList_Error.ToArray()); } if (ret != null && ret.IsSuccess) { MsgInfo successMsgInfo = new MsgInfo(); successMsgInfo.MsgTitle = str_MsgBoxTitle; successMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "I000"); successMsgInfo.MsgType = MessageType.Success; TempData[ActionMessageKey] = successMsgInfo; return(RedirectToAction("Index")); } else { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; return(View(orgVM)); } }
/// <summary> /// Home page. /// </summary> /// <returns></returns> public ActionResult Index() { var welGeekModel = new WelComeGeekModel(); var geekStr = WebCommonHelper.HttpGetWebRequest("http://geek.csdn.net/service/news/get_news_list?size=20&type=HackCount"); if (!string.IsNullOrEmpty(geekStr)) { welGeekModel = JsonConvert.DeserializeObject <WelComeGeekModel>(geekStr); } ViewBag.Html = welGeekModel.html; return(View()); }
// GET: AccessControl/LURoleManage public ActionResult Index(int page = 1, string sort = "", string sortDir = "") { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LoginUserManage_Create"); LUserRoleVM selectionCriteria = new LUserRoleVM(); GetSelectionCriteriaFromViewData(ref selectionCriteria); //Define output variable(recordCount && entityList_Result) int recordCount = 0; List <LUserRoleVM> entityList_Result = new List <LUserRoleVM>(); //Define wcf output object; RoleSerListResult entity_RoleSerListResult = null; //Instantiate WebCommonHelper in order to call wcf service WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_RoleSerListResult = roleMgtHelper.Value.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, page, PageSize, sort, sortDir, CustomFilter(selectionCriteria)); }); if (entity_RoleSerListResult != null) { recordCount = entity_RoleSerListResult.Int_TotalRecordCount; entityList_Result = entity_RoleSerListResult.EntityList_LUserRoleVM; } StorePageInfo(recordCount, page); StoreSelectionCriteria <LUserRoleVM>(null); string strError = ""; if (entity_RoleSerListResult.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_RoleSerListResult.StrList_Error.ToArray()); } if (entity_RoleSerListResult.StrList_Error.Count > 0) { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; } return(View(entityList_Result)); }
public ActionResult ChangeProspectLO(int contactId, int newOwnerAccountId, string lid) { try { UserAccount loggedUser = null; if (HttpContext != null && HttpContext.Session != null && HttpContext.Session[SessionHelper.UserData] != null) { loggedUser = ( UserAccount )HttpContext.Session[SessionHelper.UserData]; } else { // TODO: Handle if user don't have priviledges to see this log throw new UnauthorizedAccessException("User is not authorized to access this method!"); } var licenseExpiredClass = "notdisplayed"; var licenseExpiredMessage = String.Empty; var updated = ContactServiceFacade.UpdateContactOwner(contactId, newOwnerAccountId, loggedUser.UserAccountId); if (!updated || newOwnerAccountId == 0 || !WebCommonHelper.LicensingEnabled()) { return(Json(new { LicenseExpiredClass = licenseExpiredClass, LicenseExpiredMessage = licenseExpiredMessage }, JsonRequestBehavior.AllowGet)); } Guid loanId; Guid.TryParse(lid, out loanId); // Check if concierge/branch is licensed var isUserStateLicensedForLoan = UserAccountServiceFacade.IsUserStateLicensedForLoan(newOwnerAccountId, loanId, contactId); licenseExpiredMessage = LicenseHelper.ConfigureLicenseExpiredMessage(licenseExpiredMessage, isUserStateLicensedForLoan); if (!String.IsNullOrEmpty(licenseExpiredMessage)) { licenseExpiredClass = "licenseExpiredNotification"; } return(Json(new { LicenseExpiredClass = licenseExpiredClass, LicenseExpiredMessage = licenseExpiredMessage }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { TraceHelper.Error(TraceCategory.Global, "LoanController::ChangeProspectLO", ex); return(Json(null, JsonRequestBehavior.AllowGet)); } }
public ActionResult Edit(string guid) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrganizationManage_Edit"); WebCommonHelper webCommonHelper = new WebCommonHelper(); List <LUserOrgDetailsVM> entityList_OrgDetailsVM = initOrgDetailsList(); ViewBag.OrgDList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true); Guid ID = Guid.Parse(guid); string strError = ""; OrgSerEditResult entity_Return = new OrgSerEditResult(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_Return = orgMgtHelper.Value.GetEntityByID(entity_WCFAuthInfoVM, guid); }); if (entity_Return.StrList_Error.Count > 0 || entity_Return.Entity_LUserOrganizationVM == null) { if (entity_Return.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray()); } MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; LUserOrgDetailsVM selectionCriteria = new LUserOrgDetailsVM(); if (TempData.ContainsKey(SelectionCriteriaKey)) { selectionCriteria = (LUserOrgDetailsVM)TempData[SelectionCriteriaKey]; } TempData[SelectionCriteriaKey] = selectionCriteria; TempData[ActionMessageKey] = errorMsgInfo; return(RedirectToAction("Index")); } else { return(View(entity_Return.Entity_LUserOrganizationVM)); } }
public ActionResult Create(FunctionTypeVM functionTypeVM) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "FTManage_Create"); ModelState.Clear(); TryValidateModel(functionTypeVM); if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag)) { return(View()); } string strError = ""; //Define wcf output object; WCFReturnResult ret = new WCFReturnResult(); //Call WCF Service WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { ret = funTypeMgtHelper.Value.Create(entity_WCFAuthInfoVM, functionTypeVM); }); if (ret != null && ret.StrList_Error.Count() > 0) { strError = string.Join("<br/>", ret.StrList_Error.ToArray()); } if (ret != null && ret.IsSuccess) { MsgInfo successMsgInfo = new MsgInfo(); successMsgInfo.MsgTitle = str_MsgBoxTitle; successMsgInfo.MsgDesc = MultilingualHelper.GetStringFromResource(languageKey, "I000"); successMsgInfo.MsgType = MessageType.Success; TempData[ActionMessageKey] = successMsgInfo; return(RedirectToAction("Index")); } else { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; ViewBag.ActionMessage = errorMsgInfo; return(View(functionTypeVM)); } }
public void initFunsList() { WebCommonHelper webCommonHelper = new WebCommonHelper(); List <FunctionVM> entityList_FunVM = new List <FunctionVM>(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entityList_FunVM = funMgtHelper.Value.GetAll(entity_WCFAuthInfoVM); }); entityList_FunVM.ForEach(current => current.FunctionKey = current.FunctionPath + " - " + MultilingualHelper.GetStringFromResource(current.FunctionKey)); ViewBag.FunIDs = webCommonHelper.GetSelectList(entityList_FunVM, "FunctionKey", "ID", true); }
public ActionResult Edit(string guid) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "FTManage_Edit"); string strError = ""; //Define wcf output object; FTSerEditResult entity_Return = new FTSerEditResult(); //Call WCF Service WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_Return = funTypeMgtHelper.Value.GetEntityByID(entity_WCFAuthInfoVM, guid); }); if (entity_Return.StrList_Error.Count > 0 || entity_Return.Entity_FunctionTypeVM == null) { if (entity_Return.StrList_Error.Count() > 0) { strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray()); } MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; FunctionTypeVM selectionCriteria = new FunctionTypeVM(); if (TempData.ContainsKey(SelectionCriteriaKey)) { selectionCriteria = (FunctionTypeVM)TempData[SelectionCriteriaKey]; } TempData[SelectionCriteriaKey] = selectionCriteria; TempData[ActionMessageKey] = errorMsgInfo; return(RedirectToAction("Index")); } else { return(View(entity_Return.Entity_FunctionTypeVM)); } }
// GET: AccessControl/SystemInfoManage public ActionResult Index() { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "SystemInfoManage"); string strError = ""; SystemInfoVM entity_SystemInfoVM = null; WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_SystemInfoVM = systemMgtHelper.Value.GetSystemInfo(entity_WCFAuthInfoVM); }); if (entity_SystemInfoVM == null) { MsgInfo errorMsgInfo = new MsgInfo(); errorMsgInfo.MsgTitle = str_MsgBoxTitle; errorMsgInfo.MsgDesc = strError; errorMsgInfo.MsgType = MessageType.ValidationError; LUserRoleVM selectionCriteria = new LUserRoleVM(); if (TempData.ContainsKey(SelectionCriteriaKey)) { selectionCriteria = (LUserRoleVM)TempData[SelectionCriteriaKey]; } TempData[SelectionCriteriaKey] = selectionCriteria; TempData[ActionMessageKey] = errorMsgInfo; return(View("Index")); } else { if (TempData[ActionMessageKey] != null) { ViewBag.ActionMessage = TempData[ActionMessageKey]; } return(View(entity_SystemInfoVM)); } }
public ActionResult Register(RegisterModel register) { if (!ModelState.IsValid) { return(Json(new AjaxResult { Status = "error", Msg = WebCommonHelper.GetValidMsg(ModelState) })); } //防止在发送验证码之后 用户修改了手机号码 if (register.PhoneNum != (string)TempData["phoneNum"]) { return(Json(new AjaxResult { Status = "error", Msg = "手机号与注册时的手机号码不一致!" })); } if (register.SmsCode != (int)TempData["smsCode"]) { return(Json(new AjaxResult { Status = "error", Msg = "短信验证码错误!" })); } var user = UserService.GetByPhoneNum(register.PhoneNum); if (user != null) { return(Json(new AjaxResult { Status = "error", Msg = "该手机号已经注册!" })); } UserService.AddNewUser(register.PhoneNum, register.Password, register.CityId); return(Json(new AjaxResult { Status = "ok" })); }
public long UpdateUser(string phoneNum, string password, long?cityId) { using (ZSZDbContext ctx = new ZSZDbContext()) { CommonService <UserEntity> userService = new CommonService <UserEntity>(ctx); UserEntity user = userService.GetAll().Include(u => u.CityEntity).SingleOrDefault(u => u.PhoneNum == phoneNum); if (user == null) { throw new Exception("用户不存在" + phoneNum); } user.PasswordSalt = WebCommonHelper.CreateVerifyCode(4); user.PasswordHash = Common.CommonHelper.CalcMD5(user.PasswordSalt + password); user.CityId = cityId; ctx.SaveChanges(); return(user.Id); } }
public void RetrieveDropDownListInfo() { List <LUserOrgDetailsVM> entityList_OrgDetailsVM = new List <LUserOrgDetailsVM>(); List <LUserRoleVM> entityList_RoleVM = new List <LUserRoleVM>(); List <FunctionVM> entityList_FunVM = new List <FunctionVM>(); List <LUserOrganizationVM> entityList_OrgVM = new List <LUserOrganizationVM>(); WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { // Function List entityList_FunVM = funMgtHelper.Value.GetAll(entity_WCFAuthInfoVM); // Organization List entityList_OrgVM = orgMgtHelper.Value.GetAll(entity_WCFAuthInfoVM); // Role List entityList_RoleVM = roleMgtHelper.Value.GetAll(entity_WCFAuthInfoVM); // Organization Details List entityList_OrgDetailsVM = orgDetailMgtHelper.Value.GetAll(entity_WCFAuthInfoVM); }); #region [ Organization List ] entityList_OrgVM.ForEach(current => current.OrganizationKey = current.OrganizationPath + " - " + MultilingualHelper.GetStringFromResource(current.OrganizationKey)); entityList_OrgVM = entityList_OrgVM.Where(current => guidList_AccessedOrgID.Contains(current.ID)).ToList(); ViewBag.OrgList = webCommonHelper.GetSelectList(entityList_OrgVM, "OrganizationKey", "ID", true); #endregion #region [ Organization Details List ] ViewBag.OrgDetailsList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true); #endregion #region [ Role List ] ViewBag.RoleList = webCommonHelper.GetSelectList(entityList_RoleVM, "RoleName", "ID", true); #endregion #region [ Function List ] entityList_FunVM.ForEach(current => current.FunctionKey = current.FunctionPath + " - " + MultilingualHelper.GetStringFromResource(current.FunctionKey)); ViewBag.FunIDs = webCommonHelper.GetSelectList(entityList_FunVM, "FunctionKey", "ID", true); #endregion }
public ActionResult Index(FormCollection collection) { //Message Box Title -- When Error occured, Message Box would be showed. string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "AuditLogManage"); //Define output variable(recordCount && entityList_Result) int recordCount = 0; List <AuthorizedHistoryVM> entityList_Result = new List <AuthorizedHistoryVM>(); AuthorizedHistoryVM selectionCriteria = new AuthorizedHistoryVM(); typeof(AuthorizedHistoryVM).GetProperties(BindingFlags.SetProperty | BindingFlags.Public | BindingFlags.Instance).ToList().ForEach(current => { if (collection.AllKeys.Contains(current.Name)) { current.SetValue(selectionCriteria, collection[current.Name], null); } }); initOperationType(selectionCriteria.OperationType); //Define wcf output object; AHSerListResult entity_AHSerListResult = null; WebCommonHelper webCommonHelper = new WebCommonHelper(); webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) => { entity_AHSerListResult = authHisMgtHelper.Value.GetListWithPaging(entity_WCFAuthInfoVM, selectionCriteria, 1, PageSize, null, null, null); }); //Assign data to local variable if (entity_AHSerListResult != null) { recordCount = entity_AHSerListResult.Int_TotalRecordCount; entityList_Result = entity_AHSerListResult.EntityList_AuthorizedHistoryVM; } StorePageInfo(recordCount, 1); StoreSelectionCriteria <AuthorizedHistoryVM>(selectionCriteria); return(View(entityList_Result)); }