/************************************* * Created by: dandy * Created on: May 25, 2017 * Function: SavePersonInfo * Purpose: SavePersonInfo * Inputs: CardHolderInfoDTO,cardNo * Returns: SaveAcctSignUpResponse *************************************/ public async Task <SaveAcctSignUpResponse> SavePersonInfo(PersonInfoModel personalInfoModel, string entityId) { Logger.Info("Invoking SavePersonInfo function"); var response = new SaveAcctSignUpResponse() { Status = ResponseStatus.Failure, }; try { using (var scope = Container.BeginLifetimeScope()) { var cardHolderDAO = scope.Resolve <ICardHolderDAO>(); var controlDAO = scope.Resolve <IControlDAO>(); var personalInfoDto = Mapper.Map <PersonInfoModel, PersonalInfoDTO>(personalInfoModel); var result = await cardHolderDAO.SavePersonInfo(personalInfoDto, entityId); var message = await controlDAO.GetMessageCode(result); response.desp = message.Descp; response.flag = message.Flag; } response.Status = ResponseStatus.Success; } catch (Exception ex) { string msg = string.Format("Error in SavePersonInfo: detail:{0}", ex.Message); Logger.Error(msg, ex); response.Status = ResponseStatus.Exception; response.flag = 1; response.Message = msg; } return(response); }
//Tested public async Task <UpdateResult> UpdetePersonInfoAsync(PersonInfoModel Model) { if (UserLogged && Model.FirstName != null && Model.LastName != null && Model.BornDate != new DateTime() && Model.FirstName.Trim() != "" && Model.LastName.Trim() != "") { ObjectId?Id = await Convert.ToUserObjectIdOrNullAsync(User.Nickname); if (Id != null) { User.PersonInfo = new PersonInfoModel() { FirstName = Model.FirstName, LastName = Model.LastName, PhoneNumber = Model?.PhoneNumber, MailAddress = Model?.MailAddress, BornDate = Model.BornDate }; return(await UserCrud.UpdateAsync( new UserEntity { Id = Id.Value }, new UserEntity { FirstName = User.PersonInfo.FirstName, LastName = User.PersonInfo.LastName, PhoneNumber = User.PersonInfo?.PhoneNumber, MailAddress = User.PersonInfo?.MailAddress, BornDate = User.PersonInfo.BornDate.ToString() })); } } return(null); }
public async Task <JsonResult> FillData(string Prefix, string AcctNo, string AppcId, string ApplId) { switch (Prefix) { case "gen": var _GeData = (await ApplicantSignUpService.GetApplicantInfo(ApplId, AppcId, AcctNo)).cardAppcInfo; var CardData = new CardAppcInfoModel { CardType = await BaseService.GetCardType(AppcId, null, ApplId, AcctNo), PinInd = await BaseService.GetRefLib("PinInd"), SKDSNo = await BaseService.GetSKDS(ApplId, AcctNo), DialogueInd = await BaseService.GetRefLib("DialogueInd"), CurrentStatus = await BaseService.GetRefLib("AppcSts"), ProductUtilization = await BaseService.WebProductGroupSelect(), VehicleModel = await BaseService.GetRefLib("VehType"), CostCentre = !string.IsNullOrEmpty(ApplId) ? await BaseService.GetCostCentre(ApplId, "Appl", true) : await BaseService.GetCostCentre(AcctNo, "Acct", true), AnnualFee = await BaseService.GetFeeCd("ANN"), JoiningFee = await BaseService.GetFeeCd("JON"), BranchCd = await BaseService.GetRefLib("BranchCd"), DivisionCode = await BaseService.GetRefLib("DivisionCd"), DeptCd = await BaseService.GetRefLib("DeptCd"), CardMedia = await BaseService.GetCardMedia(), }; return(Json(new { Model = _GeData, Selects = CardData }, JsonRequestBehavior.AllowGet)); case "fin": var data = (await ApplicantSignUpService.GetFinancialInfo(AppcId)).cardFinancialInfo; return(Json(new { Model = data }, JsonRequestBehavior.AllowGet)); case "per": var _perData = (await CardHolderService.GetPersonInfo(Request.QueryString["EntityId"])).personalInfo; var perSelects = new PersonInfoModel { title = await BaseService.GetRefLib("Title"), IdType = await BaseService.GetRefLib("IcType"), AltIdType = await BaseService.GetRefLib("IcType"), gender = await BaseService.GetRefLib("Gender"), Occupation = await BaseService.GetRefLib("Occupation"), }; return(Json(new { Model = _perData, Selects = perSelects }, JsonRequestBehavior.AllowGet)); case "sts": var stsDetails = await CardHolderService.GetChangedAcctStsDetail(AcctNo, AppcId); var selecs = new ChangeStatus { CurrentStatus = await BaseService.GetRefLib("CardSts"), RefType = await BaseService.GetRefLib("EventType"), ReasonCode = await BaseService.GetRefLib("ReasonCd", "64"), ChangeStatusTo = await BaseService.GetRefLib("AcctSts", "") }; return(Json(new { Model = stsDetails.changeStatus, Selects = selecs }, JsonRequestBehavior.AllowGet)); default: HttpContext.Response.StatusCode = 404; return(Json(null, JsonRequestBehavior.AllowGet)); } }
public static Person ToPerson(this PersonInfoModel person) { return(new Person { Name = person.Name, Age = person.Age, Rank = person.Rank, Side = person.Side, Id = person.Id }); }
public ActionResult Create(PersonInfoModel personInfoModel) { if (ModelState.IsValid) { personInfoModel.Id = repository.AddPerson(personInfoModel.ToPerson()); return(RedirectToAction("Index")); } return(View()); }
public CardHolderResponse() { cardHolderInfo = new CardHolderInfoModel(); personalInfo = new PersonInfoModel(); changeStatus = new ChangeStatus(); cardReplacement = new CardReplacement(); cardFinancialInfoModel = new CardFinancialInfoModel(); cardHolderInfos = new List <CardHolderInfoModel>(); locationAccepts = new List <LocationAcceptListModel>(); locationAccept = new LocationAcceptListModel(); }
public ActionResult ChangeSide(PersonInfoModel model) { PersonInfoModel personInfo = repository.FindPersonById(model.Id).ToPersonInfoModel(); if (personInfo.Side) { personInfo.Side = false; repository.Save(personInfo.ToPerson()); } return(View(personInfo)); }
private async void btnLogin_Click(object sender, RoutedEventArgs e) { HideMessage(); string phone = PhoneNumber_str.Text; string password = Password_str.Password; string url = APIUrlReference.GetPersonInfo + phone + "&password="******"\"code\":502")) { txtMessage.Visibility = Visibility.Visible; txtMessage.Text = "密码错误"; } else if (content.Contains("\"code\":400")) { txtMessage.Visibility = Visibility.Visible; txtMessage.Text = "不存在该账号"; } else if (content.Contains("\"code\":415")) { txtMessage.Visibility = Visibility.Visible; txtMessage.Text = "您访问的次数太多了"; } else if (content.Contains("\"code\":200")) { txtMessage.Text = "登录成功"; txtMessage.Visibility = Visibility.Visible; //获取单例,刷新用户类信息 PersonInfoModel.GetInstance().init(content);//= JsonConvert.DeserializeObject<PersonInfoModel>(content); //获取动态消息 string url1 = APIUrlReference.GetPersonTrend + PersonInfoModel.GetInstance().bindings[0].userId; string res = await httpService.GetJsonStringAsync(url1); Debug.WriteLine(res); // HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(res, Encoding.GetEncoding("UTF-8"), "application/json") }; Debug.WriteLine(res); //由于请求的字符串多了\ "等字符需要处理,然后才可以序列化成类 res = res.Replace("\\", ""); res = res.Replace("\"{", "{"); res = res.Replace("}\"", "}"); PersonalTrendModel.GetInstance().init(res); //实例化 login(); } }
//Tested public async Task <UpdateResult> EditPfofileAsync(PersonInfoModel PersonInfo) { if (UserLogged && PersonInfo != null) { ObjectId?Id = await Convert.ToUserObjectIdOrNullAsync(User.Nickname); if (Id != null) { User.PersonInfo = PersonInfo; return(await UserCrud.UpdateAsync(new UserEntity { Id = Id.Value }, new UserEntity { LastName = PersonInfo.LastName, FirstName = PersonInfo.FirstName, MailAddress = PersonInfo.MailAddress, PhoneNumber = PersonInfo.PhoneNumber, BornDate = PersonInfo.BornDate.ToString() })); } } return(null); }
public PersonInfoView() { _model = new PersonInfoModel(0); InitializeComponent(); PanelPersonInfo.IsEnabled = true; PanelPositions.IsEnabled = true; PanelEducation.IsEnabled = true; PanelMilitary.IsEnabled = true; PanelDisability.IsEnabled = true; PanelMentalCheck.IsEnabled = true; isNewEmpl = true; PersonPositions.Items.Clear(); GridEducation.Items.Clear(); DeleteEmployee.Visibility = Visibility.Collapsed; }
public async Task <bool> UpdatePersonInfoByIdAsync(PersonInfoModel person) { string sql = @""; sql += " UPDATE persons "; sql += " SET "; sql += " last_name = @lastName "; sql += " , first_name = @firstName "; sql += " , address = @address "; sql += " , city = @city "; sql += " WHERE "; sql += " id = @id "; var conn = storage.Database.GetDbConnection(); if (conn.State == ConnectionState.Closed) { conn.Open(); } using (var trun = conn.BeginTransaction()) { try { var updateRowNum = await conn.ExecuteAsync(sql, new { person.lastName, person.firstName, person.address, person.city, person.id }, trun); trun.Commit(); return(updateRowNum > 0); } catch (Exception e) { logger.Error(e.Message); trun.Rollback(); throw e; } } }
public async Task <bool> InsertPersonInfoAsync(PersonInfoModel person) { int maxId = QueryPersonsMaxId(); string sql = @""; sql += " INSERT "; sql += " INTO persons(id, last_name, first_name, address, city) "; sql += " VALUES (@id, @lastName, @firstName, @address, @city) "; var conn = storage.Database.GetDbConnection(); if (conn.State == ConnectionState.Closed) { conn.Open(); } using (var trun = conn.BeginTransaction()) { try { var updateRowNum = await conn.ExecuteAsync(sql, new { id = maxId, person.lastName, person.firstName, person.address, person.city }, trun); trun.Commit(); return(updateRowNum > 0); } catch (Exception e) { logger.Error(e.Message); trun.Rollback(); throw e; } } }
public ActionResult PersonInfo() { WeixinApiInit(); var owner = GetCurrentUser(); if (owner != null) { PersonInfoModel model = new PersonInfoModel(); model.HeadPath = owner.HeadPath; model.UserName = owner.UserName; model.Gender = owner.Gender; model.GenderList = GetGenderList(); model.Phone = owner.Phone; model.Email = owner.Email; return(View(model)); } else { return(View()); } }
public async Task <PersonInfoModel> PersonInfoSelect(int issNo, string entityId) { var objDataEngine = new FleetDataEngine(AccessMode.CustomerService, DBType.Maint); try { objDataEngine.InitiateConnection(); SqlParameter[] Parameters = new SqlParameter[2]; Parameters[0] = new SqlParameter("@IssNo", issNo); Parameters[1] = String.IsNullOrEmpty(entityId) ? new SqlParameter("@EntityId", DBNull.Value) : new SqlParameter("@EntityId", entityId); var reader = await objDataEngine.ExecuteCommandAsync("WebEntitySelect", CommandType.StoredProcedure, Parameters); var PersonInfo = new PersonInfoModel(); while (reader.Read()) { PersonInfo.SelectedTitle = Convert.ToString(reader["Title"]); PersonInfo.FirstName = Convert.ToString(reader["First Name"]); PersonInfo.LastName = Convert.ToString(reader["Last Name"]); PersonInfo.IdNo = Convert.ToString(reader["NewIc"]); PersonInfo.SelectedIdType = Convert.ToString(reader["NewIcType"]); PersonInfo.AltIdNo = Convert.ToString(reader["AlternateIc"]); PersonInfo.SelectedAltIdType = Convert.ToString(reader["AlternateIcType"]); PersonInfo.Selectedgender = Convert.ToString(reader["Gender"]); PersonInfo.DOB = Convert.ToString(reader["DOB"]); PersonInfo.AnnualIncome = BaseClass.ConverterDecimal(reader["Income"]); PersonInfo.SelectedOccupation = Convert.ToString(reader["Occupation"]); PersonInfo.SelectedDeptId = Convert.ToString(reader["DeptId"]); PersonInfo.DrivingLicense = Convert.ToString(reader["DrivingLic"]); PersonInfo.EntityId = entityId; } return(PersonInfo); } finally { objDataEngine.CloseConnection(); } }
public async Task <MsgRetriever> SavePersonInfo(PersonInfoModel PersonInfo, string entityID) { var objDataEngine = new FleetDataEngine(AccessMode.CardHolder, DBType.Maint); try { objDataEngine.InitiateConnection(); SqlParameter[] Parameters = new SqlParameter[16]; SqlCommand cmd = new SqlCommand(); Parameters[0] = new SqlParameter("@IssNo", GetIssNo); Parameters[1] = String.IsNullOrEmpty(entityID) ? new SqlParameter("@EntityId", DBNull.Value) : new SqlParameter("@EntityId", entityID); Parameters[2] = String.IsNullOrEmpty(PersonInfo.SelectedTitle) ? new SqlParameter("@Title", DBNull.Value) : new SqlParameter("@Title", PersonInfo.SelectedTitle); Parameters[3] = String.IsNullOrEmpty(PersonInfo.FirstName) ? new SqlParameter("@FirstName", DBNull.Value) : new SqlParameter("@FirstName", PersonInfo.FirstName); Parameters[4] = String.IsNullOrEmpty(PersonInfo.LastName) ? new SqlParameter("@LastName", DBNull.Value) : new SqlParameter("@LastName", PersonInfo.LastName); Parameters[5] = String.IsNullOrEmpty(PersonInfo.IdNo) ? new SqlParameter("@NewIc", DBNull.Value) : new SqlParameter("@NewIc", PersonInfo.IdNo); Parameters[6] = String.IsNullOrEmpty(PersonInfo.SelectedIdType) ? new SqlParameter("@NewIcType", DBNull.Value) : new SqlParameter("@NewIcType", PersonInfo.SelectedIdType); Parameters[7] = String.IsNullOrEmpty(PersonInfo.AltIdNo) ? new SqlParameter("@OldIc", DBNull.Value) : new SqlParameter("@OldIc", PersonInfo.AltIdNo); Parameters[8] = String.IsNullOrEmpty(PersonInfo.SelectedAltIdType) ? new SqlParameter("@OldIcType", DBNull.Value) : new SqlParameter("@OldIcType", PersonInfo.SelectedAltIdType); Parameters[9] = String.IsNullOrEmpty(PersonInfo.Selectedgender) ? new SqlParameter("@Gender", DBNull.Value) : new SqlParameter("@Gender", PersonInfo.Selectedgender); Parameters[10] = new SqlParameter("@DOB", ConvertDatetimeDB(PersonInfo.DOB)); Parameters[11] = new SqlParameter("@Income", ConvertDecimalToDb(PersonInfo.AnnualIncome)); Parameters[12] = String.IsNullOrEmpty(PersonInfo.SelectedOccupation) ? new SqlParameter("@Occupation", DBNull.Value) : new SqlParameter("@Occupation", PersonInfo.SelectedOccupation); Parameters[13] = String.IsNullOrEmpty(PersonInfo.SelectedDeptId) ? new SqlParameter("@DeptId", DBNull.Value) : new SqlParameter("@DeptId", PersonInfo.SelectedDeptId); Parameters[14] = String.IsNullOrEmpty(PersonInfo.DrivingLicense) ? new SqlParameter("@DrivingLic", DBNull.Value) : new SqlParameter("@DrivingLic", PersonInfo.DrivingLicense); Parameters[15] = new SqlParameter("@RETURN_VALUE", SqlDbType.BigInt); Parameters[15].Direction = ParameterDirection.ReturnValue; var Cmd = await objDataEngine.ExecuteWithReturnValueAsync("WebEntityMaint", CommandType.StoredProcedure, Parameters); var Result = Convert.ToInt32(Cmd.Parameters["@RETURN_VALUE"].Value); var Descp = await GetMessageCode(Result); return(Descp); } finally { objDataEngine.CloseConnection(); } }
public PersonInfoView(PersonInfoModel infoModel, bool editable) { InitializeComponent(); if (editable == true) { PanelPersonInfo.IsEnabled = true; PanelPositions.IsEnabled = true; PanelEducation.IsEnabled = true; PanelMilitary.IsEnabled = true; PanelDisability.IsEnabled = true; PanelMentalCheck.IsEnabled = true; } infoModel.RunTasksPersonInfo(); _model = infoModel; _info = _model.Info; _positions = _model.Positions.Item1; _experience = _model.Positions.Item2; _diplomas = _model.Diplomas; _militaryInfo = _model.Military; _disabilityInfo = _model.Disability; _mentalCheck = _model.MentalCheck; PersonPositions.Items.Clear(); GridEducation.Items.Clear(); LastName.Text = _info.surname; FirstName.Text = _info.firstname; MidName.Text = _info.patronymic; iid.Text = _info.iid.ToString(); Phone.Text = _info.phone.ToString(); Address.Text = _info.emplAddress; BirthDate.SelectedDate = Convert.ToDateTime(_info.birthdate); CyclKomis.Text = _info.cyclKomis; Position.Text = _info.position; pedWork.IsChecked = _info.pedWorkload; milLiable.IsChecked = _info.isMilitaryBound; isRetired.IsChecked = _info.isRetired; sex.Text = _info.sex.ToString(); }
private async Task <int> SetUserInfo(int page) { return(await Task.Run(async() => { if (page <= UserNicknames.Count) { PageNumerationUserInfo = $"{page}/{UserNicknames.Count}"; OnPropertyChanged("PageNumerationUserInfo"); CurrentUserProfilModel = await UserBll.GetProfileInfoAsync(UserNicknames[page - 1]); NicknameUser = UserNicknames[page - 1]; OnPropertyChanged("NicknameUser"); OnPropertyChanged("FirstNameUser"); OnPropertyChanged("LastNameUser"); OnPropertyChanged("BornDateUser"); OnPropertyChanged("PhoneNumberUser"); OnPropertyChanged("MailAddressUser"); return 1; } PageNumerationUserInfo = $"{0}/{0}"; OnPropertyChanged("PageNumerationUserInfo"); return 0; })); }
public ActionResult ViewChangeSide(PersonInfoModel model) { return(View(model)); }
private void InitPersonInfo() { XmlNode node = m_pDoc.SelectSingleNode(@"root/personal_info"); m_pUser = new PersonInfoModel(node, this); }
public async Task <bool> InsertPersonInfoAsync([FromBody] PersonInfoModel person) { return(await demoManager.InsertPersonInfoAsync(person)); }
public async Task <bool> UpdatePersonInfoByIdAsync([FromBody] PersonInfoModel person) { return(await demoManager.UpdatePersonInfoByIdAsync(person)); }
public async Task <JsonResult> FillData(string Prefix, string CardNo)//,string acctNo { switch (Prefix) { case "gen": var data = (await CardHolderService.GetGeneralInfo(CardNo)).cardHolderInfo; var _cardAppcInfoSignUp = new CardHolderInfoModel { CardType = await BaseService.GetCardType(null, null, null, Request.QueryString["AcctNo"]), CostCentre = await BaseService.GetCostCentre(Request.QueryString["AcctNo"], "ACCT", true), ReasonCd = await BaseService.GetRefLib("ReasonCd"), SKDSNo = await BaseService.GetSKDS(null, Request.QueryString["AcctNo"]), RenewalInd = await BaseService.GetRefLib("RenewalInd"), DialogueInd = await BaseService.GetRefLib("DialogueInd"), PINInd = await BaseService.GetRefLib("PinInd"), ProductUtilization = await BaseService.WebProductGroupSelect(), VehicleModel = await BaseService.GetRefLib("VehSubModel"), AnnualFee = await BaseService.GetFeeCd("ANN", true), JonFee = await BaseService.GetFeeCd("JON", true), BranchCd = await BaseService.GetRefLib("BranchCd"), DivisionCode = await BaseService.GetRefLib("DivisionCd"), DeptCd = await BaseService.GetRefLib("DeptCd"), CardMedia = await BaseService.GetCardMedia() }; ViewBag.AcctNo = Request.QueryString["AcctNo"]; return(Json(new { Model = data, Selects = _cardAppcInfoSignUp }, JsonRequestBehavior.AllowGet)); case "fin": var fin = (await CardHolderService.GetFinancialInfo(CardNo)).cardFinancialInfoModel; return(Json(new { Model = fin }, JsonRequestBehavior.AllowGet)); case "per": var per = (await CardHolderService.GetPersonInfo(Request.QueryString["EntityId"])).personalInfo; var Selects = new PersonInfoModel { title = await BaseService.GetRefLib("Title"), IdType = await BaseService.GetRefLib("IcType"), AltIdType = await BaseService.GetRefLib("IcType"), gender = await BaseService.GetRefLib("Gender"), Occupation = await BaseService.GetRefLib("Occupation"), DeptId = await BaseService.GetRefLib("Dept") }; return(Json(new { Model = per, Selects = Selects }, JsonRequestBehavior.AllowGet)); case "sts": var stsDetails = await CardHolderService.GetChangedAcctStsDetail(CardNo, "CARD"); var selecs = new ChangeStatus { CurrentStatus = await BaseService.GetRefLib("CardSts"), RefType = await BaseService.GetRefLib("EventType"), ReasonCode = await BaseService.GetRefLib("ReasonCd", "32"), ChangeStatusTo = await BaseService.GetRefLib("CardSts") }; return(Json(new { Model = stsDetails.changeStatus, Selects = selecs }, JsonRequestBehavior.AllowGet)); case "rep": var rep = (await CardHolderService.GetCardReplacementInfo(CardNo)).cardReplacement; var repSelects = new CardReplacement { FeeCd = await BaseService.GetFeeCd("RPL"), ReasonCd = await BaseService.GetRefLib("ReasonCd", "32"), CurrentStatus = await BaseService.GetRefLib("CardSts"), CardMedia = await BaseService.GetCardMedia() }; return(Json(new { Model = rep, Selects = repSelects }, JsonRequestBehavior.AllowGet)); case "loc": var locationAcceptanceList = new LocationAcceptListModel { State = await BaseService.WebGetState("608"), BusnLocations = new List <SelectListItem>(), UserId = HttpContext.User.Identity.Name, CreationDate = System.DateTime.Now.ToString() }; return(Json(new { Selects = locationAcceptanceList, Model = new LocationAcceptListModel() }, JsonRequestBehavior.AllowGet)); case "pdc": var _prodDiscount = new ProductDiscount { ProdCd = await BaseService.WebProductGroupSelect(), RebatePlan = await BaseService.WebGetPlan("2"), DiscPlan = await BaseService.WebGetPlan("1"), ProdDiscType = await BaseService.GetRefLib("ProdDiscType"), PlanId = new List <SelectListItem>() }; return(Json(new { Selects = _prodDiscount, Model = new ProductDiscount() }, JsonRequestBehavior.AllowGet)); default: return(Json(new { })); } }
public async Task <ActionResult> SavePersonInfo(PersonInfoModel PersonInfo, string _entityID) { var _SavePersonInfo = await CardHolderService.SavePersonInfo(PersonInfo, _entityID); return(Json(new { resultCd = _SavePersonInfo }, JsonRequestBehavior.AllowGet)); }
public PersonInfoController(String userid) { MainDatabase db = MainDatabaseManager.GetDatabase(userid); m_pModel = db.GetUserInfo(); }
public ActionResult ChangeSide(int id) { PersonInfoModel personInfo = repository.FindPersonById(id).ToPersonInfoModel(); return(View(personInfo)); }