//保存修改按钮 private void buttonSave_Click(object sender, EventArgs e) { if (this.textBoxNickName.Text != oldNickName || this.textBoxDisc.Text != oldBoxDisc) { string url = AppConst.WebUrl + "baseInfo?protocol=" + HttpPersonalProtocol.MODIFY_BASE_INFO + "&username="******"&nickname=" + this.textBoxNickName.Text + "&description=" + this.textBoxDisc.Text; // Debug.Print(url); HttpReqHelper.requestSync(url, delegate(string result) { //收到修改后的个人信息模型 if (result == "true") { //修改模型 //修改模型将会发出事件 PersonalInfoModel newModel = new PersonalInfoModel(); newModel.Username = AppInfo.PERSONAL_INFO.Username; newModel.Nickname = this.textBoxNickName.Text; newModel.Description = this.textBoxDisc.Text; newModel.Face = AppInfo.PERSONAL_INFO.Face; AppInfo.PERSONAL_INFO = newModel; saveOKSafePost(); } else { Debug.Print("修改失败"); } }); } }
/// <summary> /// 填写个人会员信息 /// </summary> /// <returns></returns> public string SetPersonalInfo(PersonalInfoModel personal, List <string> filename, string user_id) { string responText = ""; responText = LoginInfoDal.SetPersonalInfo(personal, filename, user_id); return(responText); }
private void GroupManageMemberItem_Load(object sender, EventArgs e) { if (m_memberUsername == null) { return; } //获取昵称与头像 DataMgr.Instance.getPersonalByID(m_memberUsername, delegate(PersonalInfoModel mode) { m_mode = mode; if (mode.Nickname != null) { SetText(mode.Nickname); } //下载头像 if (mode.Face != "") { FaceMgr.Instance.getFaceByName(mode.Face, delegate(Image face) { if (face != null) { m_face = face; SetImg(face); } }); } }); }
private void FriendItem_Load(object sender, EventArgs e) { GraphicsPath path = new GraphicsPath(); path.AddArc(friendFacePictureBox.DisplayRectangle, 0, 360); friendFacePictureBox.Region = new Region(path); m_SyncContext = SynchronizationContext.Current; //获取这个好友的基本信息 DataMgr.Instance.getPersonalByID(FriendUsername, delegate(PersonalInfoModel friendModel) { Debug.Print("朋友的信息:" + FriendUsername + " " + friendModel.Username + friendModel.Nickname); m_friendModel = friendModel; initLabelSafePost(); //下载头像 if (m_friendModel.Face != "") { FaceMgr.Instance.getFaceByName(m_friendModel.Face, delegate(Image face) { if (face != null) { friendFacePictureBox.Image = face; } }); } }); }
/// <summary> /// 人员详细结构化 /// </summary> /// <returns></returns> public ActionResult PopulationDetailStructuring(string pid = "", int pageIndex = 1, int pageSize = 10) { MySqlParameter parentid = new MySqlParameter("pid", pid); view_detail view_dt = jz.Database.SqlQuery <view_detail>("select * from tpersons as a left JOIN businessinfo as b on a.D=b.IDNUMBER WHERE a.d=@pid", parentid).Take(1).ToList()[0]; List <user_report> list_user_report = jz.Database.SqlQuery <user_report>("select * from user_report as a WHERE cardid =@pid", parentid).ToList(); jz.user_report.Where(m => m.cardid == pid); Type t = view_dt.GetType(); PropertyInfo[] list = t.GetProperties(); List <PersonalInfoModel> listShow = new List <PersonalInfoModel>(); for (int i = 0; i < list.Length; i++) { PersonalInfoModel p = new PersonalInfoModel(); p.Key = list[i].Name; p.Value = list[i].GetValue(view_dt, null) == null ? "" : list[i].GetValue(view_dt, null).ToString(); listShow.Add(p); } for (int i = 0; i < list_user_report.Count; i++) { listShow.Add(new PersonalInfoModel() { Key = list_user_report[i].attrName, Value = list_user_report[i].attrVal }); } return(View(listShow.ToPagedList(pageIndex, pageSize))); }
public PersonalInfoModel Login(string username, string password) { PersonalInfoModel info = new PersonalInfoModel(); try { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { return(null); } var user = _context.CandidateData.FirstOrDefault(x => x.Email == username); if (user.Email == username && user.Pwd == password) { //return user.CandidateId; info.CandidateId = user.CandidateId; info.FirstName = user.FirstName; info.LastName = user.LastName; info.Email = user.Email; info.PhoneNumber = user.PhoneNumber; } return(info); } catch { return(null); } }
public IHttpActionResult PutPersonalInfo(int id, PersonalInfoModel personalInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != personalInfo.Id) { return(BadRequest()); } db.Entry(personalInfo).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PersonalInfoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public JsonResult Index(int id) { var customer = this.customerRepository.Get(id); var model = new PersonalInfoModel(); model.InitFromCustomer(customer); return(Json(model, JsonRequestBehavior.AllowGet)); } //Index
public ActionResult ApiGet() { ApiModel key = null; using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://interns.bcgdvsydney.com/api/v1/key"); var responseTask = client.GetAsync("key"); responseTask.Wait(); var result = responseTask.Result; var status = responseTask.Status; if (result.IsSuccessStatusCode) { var readTask = result.Content.ReadAsAsync<ApiModel>(); readTask.Wait(); key = readTask.Result; } else { ModelState.AddModelError(string.Empty, "Server error try after some time."); } client.BaseAddress = new Uri("https://interns.bcgdvsydney.com/api/v1/submit?apiKey="+key.Key); PersonalInfoModel myInfo = new PersonalInfoModel(); myInfo.Email = ""; // Your email here myInfo.Name = ""; //Your name here var content = new StringContent(myInfo.ToString(), Encoding.UTF8, "application/json"); var postTask = client.PostAsync("https://interns.bcgdvsydney.com/api/v1/submit?apiKey=" + key.Key, content); postTask.Wait(); var resultPost = postTask.Result; if (resultPost.IsSuccessStatusCode) { return RedirectToAction("Index"); } //ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator."); //return View(student); return View(key); // return View(); } }
/// <summary> /// 获取通联个人信息 /// </summary> /// <param name="memberId"></param> /// <returns></returns> public PersonalInfoModel GetPersonalInfo(string memberId) { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("memberId", memberId); string result = WebHelper.HttpClientResultJson(AccountInterface + "Registered/GetPersonalInfo", dic); PersonalInfoModel requestResult = JsonConvert.DeserializeObject <PersonalInfoModel>(result); return(requestResult); }
public void SetPersionalCard(Point location, PersonalInfoModel model, Image face) { this.labelNickName.Text = model.Nickname; this.labelUsername.Text = "(" + model.Username + ")"; this.labelDiscription.Text = model.Description; this.pictureBoxFace.Image = face; location = new Point(location.X - this.Width - 20, location.Y - 10);//调整一下位置 this.Location = location; this.Show(); }
protected async Task GetUserInformations() { var user = await ProfileAppService.GetAsync(); ChangePasswordModel = new ChangePasswordModel { HideOldPasswordInput = !user.HasPassword }; PersonalInfoModel = ObjectMapper.Map <ProfileDto, PersonalInfoModel>(user); }
public ActionResult ChangePersonalInfo(string returnUrl) { ViewBag.ReturnUrl = returnUrl; var userInfo = new PersonalInfoModel(); using (var context = new UsersContext()) { var profile = context.UserProfiles.FirstOrDefault(u => u.UserName == User.Identity.Name); userInfo.Name = profile.Name; userInfo.Email = profile.UserName; userInfo.Phone = profile.Phone; } return(PartialView("_ChangePersonalInfoPartial", userInfo)); }
//朋友资料时调用 public FormShowPersonalInfo(PersonalInfoModel friendModel, Image face) { InitializeComponent(); m_windowType = 3; m_SyncContext = SynchronizationContext.Current; this.labelNickName.Text = friendModel.Nickname; this.labelUsername.Text = friendModel.Username; this.textBoxDescription.Text = friendModel.Description; this.pictureBoxFace.Image = face; m_PersonalInfoModel = friendModel; //隐藏修改内容 this.labelChangeFace.Hide(); this.labelModify.Hide(); }
// GET: api/PersonalInfoes public List <PersonalInfoModel> GetPersonalInfo() { List <PersonalInfoModel> PM = new List <PersonalInfoModel>(); foreach (var row in db.PersonalInfo) { PersonalInfoModel temp = new PersonalInfoModel { Id = row.Id, //PersonellNumber = row.PersonellNumber, FirstName = row.FirstName, LastName = row.LastName, ScheduleCode = row.ScheduleCode }; PM.Add(temp); } return(PM); }
public ActionResult PersonalInformation(PersonalInfoModel personalInfo) { if (ModelState.IsValid) { var errors = ModelState.Values.SelectMany(v => v.Errors); int userId = (int)Session["id"]; user userInfo = new user(); userInfo.display_name = personalInfo.display_name; userInfo.date_of_birth = personalInfo.date_of_birth; userInfo.address = personalInfo.address; userInfo.gender = personalInfo.gender; userInfo.phone_number = personalInfo.phone_number; var updatedUser = new UsersModels().updateUser(userId, userInfo); Session["display_name"] = updatedUser.display_name; return(Redirect("~/Thong-Tin-Ca-Nhan")); } return(View(personalInfo)); }
public ActionResult PersonalInformation() { PersonalInfoModel personalInfoModel = new PersonalInfoModel(); if (Session["id"] == null) { return(Redirect("~/Dang-Nhap")); } int id = (int)Session["id"]; var user = new UsersModels().getUserById(id); personalInfoModel.display_name = user.display_name; personalInfoModel.date_of_birth = user.date_of_birth; personalInfoModel.address = user.address; personalInfoModel.gender = user.gender; personalInfoModel.phone_number = user.phone_number; return(View(personalInfoModel)); }
public ActionResult SetPersonalInfo(PersonalInfoModel Personal) { LoginBll LoginInfoBll = new LoginBll(); string responseText = ""; GetUserInfoDal getuserinfodal = new GetUserInfoDal(); string openid = CookieHelper.GetCookieValue("openid"); string user_id = getuserinfodal.GetUserID(openid); string fileExt = ""; List <string> filename = new List <string>(); //string chat_head_name = Request["chat_head_name"]; //string id_card_name = Request["id_card_name"]; int cnt = System.Web.HttpContext.Current.Request.Files.Count; for (int i = 0; i < cnt; i++) { HttpPostedFile hpf = System.Web.HttpContext.Current.Request.Files[i]; string filenames = Path.GetFileName(hpf.FileName); fileExt = Path.GetExtension(hpf.FileName).ToLower();//带.的后缀 filename.Add(filenames); string fileFilt = ".jpg|.jpeg|.png|.JPG|.PNG|......"; if ((fileFilt.IndexOf(fileExt) <= -1) || (fileExt == "") || (hpf.ContentLength > 4 * 1024 * 1024)) { continue; } // string filepath = HttpContext.Server.MapPath("../xwhz_uploadimages/template/" + filenames); ///string filepath = context.Server.MapPath("E:\\inetpub\\wwwroot\\sj_uploadimage\\ZJZ_PIC\\" + hpf.FileName); if (i == 0) { hpf.SaveAs("D:\\MVCRoot\\gxdzwx\\gxdzimages\\gxdzwxlogin\\personal\\chat_head\\" + filenames); // hpf.SaveAs("G:\\Visual Studio\\image\\" + filenames); } if (i == 1) { hpf.SaveAs("D:\\MVCRoot\\gxdzwx\\gxdzimages\\gxdzwxlogin\\personal\\id_card\\" + filenames); // hpf.SaveAs("G:\\Visual Studio\\image\\" + filenames); } // hpf.SaveAs("G://Visual Studio//IMP"); // var mappedPath = System.Web.Hosting.HostingEnvironment.MapPath("~/"); // hpf.SaveAs(filepath); } responseText = LoginInfoBll.SetPersonalInfo(Personal, filename, user_id); return(Content(responseText)); }
public ActionResult ManagePersonalInfo(PersonalInfoModel model) { bool hasLocalAccount = OAuthWebSecurity.HasLocalAccount(WebSecurity.GetUserId(User.Identity.Name)); ViewBag.HasLocalPassword = hasLocalAccount; ViewBag.ReturnUrl = Url.Action("Manage"); if (ModelState.IsValid) { using (var context = new UsersContext()) { var userProfile = context.UserProfiles.FirstOrDefault(u => u.UserName == User.Identity.Name); if (userProfile != null) { try { userProfile.Name = model.Name; userProfile.UserName = model.Email; userProfile.Phone = model.Phone; context.SaveChanges(); TraceLog.TraceInfo(string.Format("Changed personal information for user {0}", User.Identity.Name)); } catch (Exception ex) { TraceLog.TraceException("Could not save personal information", ex); return(View(model)); } } else { TraceLog.TraceError(string.Format("Could not find user {0} to change personal information", User.Identity.Name)); return(RedirectToAction("Manage", new { Message = ManageMessageId.ChangePersonalInfoFailure })); } } return(RedirectToAction("Manage", new { Message = ManageMessageId.ChangePersonalInfoSuccess })); } else { ModelState.AddModelError("", "One of the values is invalid."); } // If we got this far, something failed, redisplay form return(View(model)); }
public IHttpActionResult GetPersonalInfo(int id) { PersonalInfo personalInfo = db.PersonalInfo.Find(id); if (personalInfo == null) { return(NotFound()); } PersonalInfoModel temp = new PersonalInfoModel { Id = personalInfo.Id, //PersonellNumber = personalInfo.PersonellNumber, FirstName = personalInfo.FirstName, LastName = personalInfo.LastName, ScheduleCode = personalInfo.ScheduleCode }; return(Ok(temp)); }
public IHttpActionResult PostPersonalInfo(PersonalInfoModel personalInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } PersonalInfo temp = new PersonalInfo { Id = personalInfo.Id, //PersonellNumber = personalInfo.PersonellNumber, FirstName = personalInfo.FirstName, LastName = personalInfo.LastName, ScheduleCode = personalInfo.ScheduleCode }; db.PersonalInfo.Add(temp); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = personalInfo.Id }, personalInfo)); }
public void getPersonalByID(string personalId, RequestPersonalInfoEvent callBack) { if (personalId == string.Empty || personalId == null) { if (callBack != null) { callBack(new PersonalInfoModel()); } return; } if (personalDic.ContainsKey(personalId)) { if (callBack != null) { callBack(personalDic[personalId]); } } else //请求这个人的信息,请求完后要更新至字典中。 { HttpReqHelper.requestSync(AppConst.WebUrl + "baseInfo?protocol=" + HttpPersonalProtocol.BASE_INFO + "&username="******"DataMgr.getPersonalByID解析失败" + err.ToString()); if (callBack != null) { callBack(default(PersonalInfoModel)); } } }); } }
public PersonalInfoModel GetCandidateById(int id) { var obj = _context.CandidateData.Where(e => e.CandidateId == id).FirstOrDefault(); PersonalInfoModel info = new PersonalInfoModel(); if (obj != null) { info.CandidateId = obj.CandidateId; info.FirstName = obj.FirstName; info.MiddleName = obj.MiddleName; info.LastName = obj.LastName; info.Email = obj.Email; info.Gender = obj.Gender; info.AdharNumber = obj.AdharNumber; info.Nationality = obj.Nationality; info.PassportNo = obj.PassportNo; info.ProfilePic = obj.ProfilePic; info.Resume = obj.Resume; } return(info); }
/// <summary> /// 填写个人会员信息 /// </summary> /// <returns></returns> public string SetPersonalInfo(PersonalInfoModel personal, List <string> filename, string user_id) { string responseText = ""; string chat_headname = ""; string id_cardname = ""; int count = filename.Count; chat_headname = filename[0]; id_cardname = filename[1]; // string sql = string.Format("insert into GX_USER_MEMBER_PERSONAL(USER_ID,CHAT_HEAD,NICK_NAME,SIGNATURE,NAME,ID_NUMBER,SEX,AGE,INDUSTRY_INVOLVED,COMPANY,PROFESSION,TEL,FAX,EMAIL,ID_CARD) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}')", user_id, chat_headname, personal.nick_name, personal.signature, personal.name, personal.id_number, personal.sex, personal.age, personal.industry_involved, personal.company, personal.profession, personal.tel, personal.fax, personal.email,id_cardname); string sql = string.Format("update GX_USER_MEMBER_PERSONAL set CHAT_HEAD='{0}',NICK_NAME='{1}',SIGNATURE='{2}',NAME='{3}',ID_NUMBER='{4}',SEX='{5}',INDUSTRY_INVOLVED='{6}',COMPANY='{7}',PROFESSION='{8}',TEL='{9}',FAX ='{10}',EMAIL='{11}',ID_CARD='{12}' where USER_ID = '{13}'", chat_headname, personal.nick_name, personal.signature, personal.name, personal.id_number, personal.sex, personal.industry_involved, personal.company, personal.profession, personal.tel, personal.fax, personal.email, id_cardname, user_id); int flag = OracleHelper.ExecuteNonQuery(sql, null); if (flag > 0) { responseText = "success"; } else { responseText = "fail"; } return(responseText); }
public ActionResult SavePersonalInfo(VoicerFilterModel model) { PersonalInfoModel m = new PersonalInfoModel(); m.info = model; if (_userRepository.Save(m.ToEntity(_userRepository.FirstOrDefault(x => x.Id == _userID))) > 0) { #region Hobby var itemsHobby = _userHobbyRepository.LoadAndSelect(x => x.UserId == _userID, x => x, false); var itemsHobbyListId = itemsHobby.Select(x => x.Id).ToList(); if (model._hobby_ids == null) { model._hobby_ids = new List <int>() { } } ; foreach (var item in itemsHobby) { if (!model._hobby_ids.Contains(item.Id)) { _userHobbyRepository.Remove(item); } } foreach (var item in model._hobby_ids) { if (!itemsHobbyListId.Contains(item)) { _userHobbyRepository.Save(new UsersHobbyUser() { UserId = _userID, UsersHobbyId = item }); } } #endregion #region Occupation var itemsOccupation = _userOccupationRepository.LoadAndSelect(x => x.UserId == _userID, x => x, false); var itemsOccupationListId = itemsOccupation.Select(x => x.Id).ToList(); if (model._occupation_ids == null) { model._occupation_ids = new List <int>() { } } ; foreach (var item in itemsOccupation) { if (!model._occupation_ids.Contains(item.Id)) { _userOccupationRepository.Remove(item); } } foreach (var item in model._occupation_ids) { if (!itemsOccupationListId.Contains(item)) { _userOccupationRepository.Save(new UsersOccupationsUser() { UserId = _userID, UsersOccupationsId = item }); } } #endregion } return(Json(new Message(TMessage.TRUE), JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage UpdateUser(PersonalInfoModel personalInfo) { }
public JsonResult Index(int id) { log.Debug("Build full customer model begin for customer {0}", id); var model = new FullCustomerModel(); var customer = this.customerRepo.ReallyTryGet(id); if (customer == null) { model.State = "NotFound"; return(Json(model, JsonRequestBehavior.AllowGet)); } // if TimeCounter tc = new TimeCounter("FullCustomerModel building time for customer " + customer.Stringify()); using (tc.AddStep("Customer {0} total FullCustomerModel time taken", customer.Stringify())) { var cr = customer.LastCashRequest; using (tc.AddStep("PersonalInfoModel Time taken")) { var pi = new PersonalInfoModel(); pi.InitFromCustomer(customer); model.PersonalInfoModel = pi; } // using using (tc.AddStep("ApplicationInfoModel Time taken")) { try { var aiar = this.serviceClient.Instance.LoadApplicationInfo( this.context.UserId, customer.Id, cr == null ? (long?)null : cr.Id, DateTime.UtcNow ); model.ApplicationInfoModel = aiar.Model; } catch (Exception ex) { log.Error(ex, "Failed to load application info model for customer {0} cr {1}", customer.Id, cr == null ? (long?)null : cr.Id); } } // using using (tc.AddStep("CreditBureauModel Time taken")) model.CreditBureauModel = this.creditBureauModelBuilder.Create(customer); using (tc.AddStep("CompanyScore Time taken")) { var builder = new CompanyScoreModelBuilder(); model.CompanyScore = builder.Create(customer); DateTime?companySeniority = model.CompanyScore.DashboardModel.OriginationDate; int companySeniorityYears = 0, companySeniorityMonths = 0; if (companySeniority.HasValue) { MiscUtils.GetFullYearsAndMonths( companySeniority.Value, out companySeniorityYears, out companySeniorityMonths ); } // if model.PersonalInfoModel.CompanySeniority = string.Format( "{0}y {1}m", companySeniorityYears, companySeniorityMonths ); model.PersonalInfoModel.IsYoungCompany = companySeniority.HasValue && companySeniority.Value.AddYears(1) > DateTime.UtcNow && ( companySeniority.Value.Year != DateTime.UtcNow.Year || companySeniority.Value.Month != DateTime.UtcNow.Month || companySeniority.Value.Day != DateTime.UtcNow.Day ); } // using using (tc.AddStep("SummaryModel Time taken")) model.SummaryModel = this.summaryModelBuilder.CreateProfile(customer, model.CreditBureauModel, model.CompanyScore); using (tc.AddStep("MedalCalculations Time taken")) model.MedalCalculations = new MedalCalculators(customer); using (tc.AddStep("PropertiesModel Time taken")) model.Properties = this.propertiesModelBuilder.Create(customer); using (tc.AddStep("CustomerRelations Time taken")) { var crm = new CustomerRelationsModelBuilder( this.loanRepo, this.customerRelationsRepo, this.session ); model.CustomerRelations = crm.Create(customer.Id); } // using using (tc.AddStep("Bugs Time taken")) { model.Bugs = this.bugRepo .GetAll() .Where(x => x.Customer.Id == customer.Id) .Select(x => BugModel.ToModel(x)) .ToList(); } // using using (tc.AddStep("ExperianDirectors Time taken")) { var expDirModel = CrossCheckModel.GetExperianDirectors(customer); model.ExperianDirectors = expDirModel.DirectorNames; model.PersonalInfoModel.NumOfDirectors = expDirModel.NumOfDirectors; model.PersonalInfoModel.NumOfShareholders = expDirModel.NumOfShareHolders; } // using model.State = "Ok"; } // using "Total" step log.Info(tc.ToString()); log.Debug("Build full customer model end for customer {0}", id); return(Json(model, JsonRequestBehavior.AllowGet)); } // Index
public ProfileModel() { PersonalInfo = new PersonalInfoModel(); AddressInfo = new AddressModel(); }