public static UserSessionEntry Login(this HttpSessionStateBase session, Flh.Business.IUserManager manager, string username, string password, string ip) { var user = manager.Login(username, password, ip); var entry = new UserSessionEntry { Name = user.Name, Uid = user.Uid }; SetCurrentUser(session, entry); return entry; }
public UserInfoModel(Flh.Business.Data.User u) { if (u != null) { Mobile = u.mobile; Email = u.email; Name = u.name; Company = u.company; AreaNo = u.area_no; Address = u.address; EmployeesCountRange = u.employees_count_type; IndustryNo = u.industry_no; IsPurchaser = u.is_purchaser; NeetInvoice = u.neet_invoice; Tel = u.tel; } }
public static SelectListItem[] GetEmployeesCountRangeSelectListItems(bool addEmptyItem, Flh.Business.Users.EmployeesCountRanges? selected) { var creater = new Func<string, Flh.Business.Users.EmployeesCountRanges, SelectListItem>((name, value) => { return new SelectListItem { Text = name, Value = ((byte)value).ToString(), Selected = selected.HasValue && selected.Value == value }; }); var result = new List<SelectListItem>(); if(addEmptyItem) result.Add(new SelectListItem { Text = "--公司从业人员数--" }); result.Add(creater("1-9人", Business.Users.EmployeesCountRanges.R1To9)); result.Add(creater("10-99人", Business.Users.EmployeesCountRanges.R10To99)); result.Add(creater("100-499人", Business.Users.EmployeesCountRanges.R100To499)); result.Add(creater("500-999人", Business.Users.EmployeesCountRanges.R500To999)); result.Add(creater("1000人及以上", Business.Users.EmployeesCountRanges.R1000More)); return result.ToArray(); }