private void InitUserInfo() { UserProfileBLL bll = new UserProfileBLL(); UserProfileInfo up = bll.GetUserProfile(UserCode); //UserProfile up = DBManager.GetUserProfile(UserCode); txtADAccount.Text = up.ADAccount; txtBirthDate.Text = up.Birthdate; txtCellPhone.Text = up.CellPhone; txtCHNName.Text = up.CHName; txtCostCenter.Text = up.CostCenter; txtEmail.Text = up.Email; txtENName.Text = up.ENName; txtHireDate.Text = up.HireDate; txtManagerAccount.Text = up.ManagerAccount; txtOfficePhone.Text = up.OfficePhone; txtFax.Text = up.FAX; txtBlackBerry.Text = up.BlackBerry; txtGraduateFrom.Text = up.GraduateFrom; txtOAC.Text = up.OAC; txtPA.Text = up.PoliticalAffiliation; txtPositionDesc.Text = up.PositionName; txtEductionBackground.Text = up.EducationalBackground; txtWorkExperienceBefore.Text = up.WorkExperienceBefore; txtWorkExperienceNow.Text = up.WorkExperienceNow; txtOrderNO.Text = up.OrderNo.ToString(); txtPhotoUrl.Text = up.PhotoUrl; imgPhono.ImageUrl = string.IsNullOrEmpty(up.PhotoUrl) ? imgPhono.ImageUrl : up.PhotoUrl; ddlGender.SelectedIndex = ddlGender.Items.IndexOf(ddlGender.Items.FindByValue(up.Gender)); ddlPosition.SelectedIndex = ddlPosition.Items.IndexOf(ddlPosition.Items.FindByValue(up.PositionGuid.ToString())); ddlWorkPlace.SelectedIndex = ddlWorkPlace.Items.IndexOf(ddlWorkPlace.Items.FindByValue(up.WorkPlace)); }
protected void btnDelete_Click(object sender, EventArgs e) { string formCodes = ""; for (int i = 0; i < gvForms.Rows.Count; i++) { CheckBox chkUser = (CheckBox)(gvForms.Rows[i].FindControl("chkForm")); if (chkUser.Checked) { HiddenField hfFormCode = (HiddenField)(gvForms.Rows[i].FindControl("hfFormCode")); formCodes += hfFormCode.Value + ";"; } } if (formCodes.LastIndexOf(';') == (formCodes.Length - 1)) { formCodes = formCodes.Remove(formCodes.LastIndexOf(';')); } if (formCodes != "") { //DBManager.DeleteExtProp(formCodes); UserProfileBLL bll = new UserProfileBLL(); bll.DeleteExtProp(formCodes); BindData(); } }
private void Save() { MeanEvent(form, new EventArgs());//先获取meaning的设置 if (_userbll == null) { _userbll = new UserInfoBLL(); } UserMeaning um = dic[WizardName.CreateMean] as UserMeaning; if (_userbll.InsertUserWizard(user, policy, (dic[WizardName.CreateRight] as UserRight).Right, um.mEntity)) { UserProfileBLL userProfileBll = new UserProfileBLL(); UserProfile userProfile = new UserProfile(); userProfile.ID = userProfileBll.GetProfilePKValue() + 1; userProfile.UserName = user.UserName; userProfile.TempCurveRGB = Common.GlobalProfile.TempCurveRGB; userProfile.AlarmLineRGB = Common.GlobalProfile.AlarmLineRGB; userProfile.IdealRangeRGB = Common.GlobalProfile.IdealRangeRGB; userProfile.IsShowAlarmLimit = Common.GlobalProfile.IsShowAlarmLimit; userProfile.IsShowMark = Common.GlobalProfile.IsShowMark; userProfile.IsFillIdealRange = Common.GlobalProfile.IsFillIdealRange; userProfile.DateTimeFormator = Common.GlobalProfile.DateTimeFormator; userProfile.Remark = DateTime.Now.ToString(); userProfile.ContactInfo = ""; userProfile.Logo = ShineTech.TempCentre.Platform.Utils.CopyToBinary(Properties.Resources.tempsen); userProfile.DefaultPath = ""; userProfile.ReportTitle = ""; userProfile.IsGlobal = (int)GlobalType.None; userProfile.IsShowHeader = false; userProfile.TempUnit = "C"; userProfileBll.InsertProfile(userProfile); //insert sys log InsertCreateUserLog(); InsertAssignRightsLog(); // new implementation of meanings if (flag) { DialogResult result = Utils.ShowMessageBox(Messages.FirstCreate, Messages.TitleNotification, MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { form.DialogResult = DialogResult.OK; } else { form.DialogResult = DialogResult.No; } } else { form.DialogResult = DialogResult.OK; } } else { form.DialogResult = DialogResult.No; } }
public ActionResult Detail(Guid id) { var pro = new UserProfileBLL().GetUserProfileSet(id); pro.CountryName = FoundationDB.CountryDb.GetById(pro.CountryId).Name; return(View(pro)); }
protected void btnAddUserHF_Click(object sender, EventArgs e) { UserProfileBLL bll = new UserProfileBLL(); bll.AddDeptUser(DeptCode, hfSelectUserAD.Value); lbReload_Click(sender, e); }
/// <summary> /// 通过参数取得用户信息 /// </summary> /// <returns></returns> private string GetUsersByParams(HttpContext context) { try { string name_startsWith = context.Request.QueryString["name_startsWith"]; string maxRows = context.Request.QueryString["maxRows"]; string orgID = context.Request.QueryString["orgID"]; string strMain = context.Request.QueryString["is_main"]; if (string.IsNullOrEmpty(name_startsWith) || string.IsNullOrEmpty(maxRows) || string.IsNullOrEmpty(strMain)) { return("Fail"); } else { bool isMain = strMain == "true" ? true : false; UserProfileBLL bll = new UserProfileBLL(); DataTable dt = bll.GetUsersByFilter(maxRows, orgID, name_startsWith, isMain); return(EasyUIJsonConvert.GetAutoCompleteJson(dt)); } } catch (Exception ex) { DBManager.RecoreErrorProfile(ex, "RuleDesignHandler.GetUsersByParams", DBManager.GetCurrentUserAD()); return("Fail"); } }
private void BindData() { //DataSet ds = DBManager.GetUserByType(DeptCode, SelectType, txtFilter.Text); UserProfileBLL bll = new UserProfileBLL(); DataSet ds = bll.GetUserByType(DeptCode, SelectType, txtFilter.Text); gvUser.DataSource = ds; gvUser.DataBind(); }
private void BindData() { //DataTable dt = DBManager.GetUserProfileOutDept(deptCode,txtFilter.Text); UserProfileBLL bll = new UserProfileBLL(); IList <UserProfileInfo> upList = bll.GetUserProfileOutDept(deptCode, txtFilter.Text); gvUser.DataSource = upList; gvUser.DataBind(); }
// GET: user public async Task <IActionResult> Index(string username, string status = null, string uid = null) { var model = new UserModelView(); model.ActiveIndex = 0; if (!InitProfile(model, username)) { return(Redirect(Config.GetUrl() + "signin?ReturnUrl=" + Config.GetUrl(username))); } // fetch profile user information var query = new MemberEntity() { ispublic = true, loadall = true }; if (Jugnoon.Settings.Configs.RegistrationSettings.uniqueFieldOption == 0) { query.username = model.UserName; } else { query.userid = model.UserName; } var userInfo = await UserProfileBLL.LoadItems(_context, query); if (userInfo.Count > 0) { // increment user views int _views = userInfo[0].views + 1; UserBLL.Update_Field_Id(_context, userInfo[0].Id, "views", _views); model.user = userInfo[0]; model.Nav = new NavModelView() { username = model.user.Id, ActiveIndex = 100 }; model.UserInfo = prepare_user_info(model); model.FullName = UserUrlConfig.PrepareUserName(model.user, Jugnoon.Settings.Configs.RegistrationSettings.uniqueFieldOption); ViewBag.title = model.FullName + "'s " + SiteConfig.generalLocalizer["_profile"].Value; ViewBag.description = ViewBag.title + ", info: " + model.UserInfo + ", date joined: " + model.user.created_at; } else { model.UserExist = false; } return(View(model)); }
private void InitUserInfo() { //UserProfile up = DBManager.GetUserProfile(UserCode); UserProfileBLL bll = new UserProfileBLL(); UserProfileInfo up = bll.GetUserProfile(UserCode); txtADAccount.Text = up.ADAccount; txtBirthDate.Text = up.Birthdate; txtCellPhone.Text = up.CellPhone; txtCHNName.Text = up.CHName; txtCostCenter.Text = up.CostCenter; txtEmail.Text = up.Email; txtENName.Text = up.ENName; txtHireDate.Text = up.HireDate; txtManagerAccount.Text = up.ManagerAccount; txtOfficePhone.Text = up.OfficePhone; txtFax.Text = up.FAX; txtBlackBerry.Text = up.BlackBerry; txtGraduateFrom.Text = up.GraduateFrom; txtOAC.Text = up.OAC; txtPA.Text = up.PoliticalAffiliation; txtEductionBackground.Text = up.EducationalBackground; txtWorkExperienceBefore.Text = up.WorkExperienceBefore; txtWorkExperienceNow.Text = up.WorkExperienceNow; txtOrderNO.Text = up.OrderNo.ToString(); txtPhotoUrl.Text = up.PhotoUrl; imgPhono.ImageUrl = string.IsNullOrEmpty(up.PhotoUrl) ? imgPhono.ImageUrl : up.PhotoUrl; ddlGender.SelectedIndex = ddlGender.Items.IndexOf(ddlGender.Items.FindByValue(up.Gender)); ddlPosition.SelectedIndex = ddlPosition.Items.IndexOf(ddlPosition.Items.FindByValue(up.PositionGuid.ToString())); ddlWorkPlace.SelectedIndex = ddlWorkPlace.Items.IndexOf(ddlWorkPlace.Items.FindByValue(up.WorkPlace)); //DataTable dt = DBManager.GetUserMainDepartmentByCode(UserCode); //if (dt != null && dt.Rows.Count > 0) // txtMainDeptName.Text = dt.Rows[0]["Department"].ToString(); DataTable dt = DBManager.GetUserMainDepartmentByCode(UserCode); if (dt != null && dt.Rows.Count != 0) { foreach (DataRow dr in dt.Rows) { try { if (Boolean.Parse(dr["IsMainDept"].ToString())) { txtMainDeptName.Text = dr["DeptName"].ToString(); } } catch { } } } }
protected void btnChoose_Click(object sender, EventArgs e) { string usercode = hfSelectedUser.Value; //DBManager.AddDeptUser(deptCode, usercode); UserProfileBLL bll = new UserProfileBLL(); bll.AddDeptUser(deptCode, usercode); litScript.Text = "<script>window.returnValue='';window.close();</script>"; }
/// <summary> /// LoadEmployeeInfo 根据员工ID获取员工信息 /// </summary> private void LoadEmployeeInfo(string Code) { UserProfileBLL bll = new UserProfileBLL(); UserProfileInfo info = bll.GetUserProfile(Code); SubmitName.Value = info.CHName; SubmitID.Value = info.ID.ToString(); ApplicantName.Value = SubmitName.Value; lbl_date.Text = DateTime.Now.ToString("yyyy-MM-dd"); }
/// <summary> /// 绑定扩展信息 /// </summary> private void BindExtPro() { //DataTable dt = DBManager.GetUserExtProperty(UserCode); UserProfileBLL bll = new UserProfileBLL(); IList <UserProfileExtPropertyInfo> upepList = bll.GetUserExtProperty(UserCode); if (upepList != null) { dlExtendInfo.DataSource = upepList; dlExtendInfo.DataBind(); } }
public ActionResult Detail(Guid id) { var pro = new UserProfileBLL().GetUserProfile(id); var profile = ReflectionHelper.AutoCopy <Entities.UserProfile, UserProfileViewModel>(pro); profile.L1VerifyStatusName = profile.L1VerifyStatus.HasValue ? ((VerifyStatus)profile.L1VerifyStatus.Value).ToString() : ""; profile.IdentityDocTypeName = profile.IdentityDocType.HasValue ? ((IdentityDocType)profile.IdentityDocType.Value).ToString() : ""; var profileSDK = new UserProfileAgent(); int count = profileSDK.GetCountByIdentityDocNo(profile.UserAccountId.Value, pro.IdentityDocNo); ViewBag.IdentityCount = count; return(View(profile)); }
public ActionResult Detail(Guid id) { var pro = new UserProfileBLL().GetUserProfile(id); var profile = ReflectionHelper.AutoCopy <Entities.UserProfile, UserProfileViewModel>(pro); if (profile.Country.HasValue) { profile.CountryName = FoundationDB.DB.Queryable <Countries>().Where(t => t.Id == profile.Country).Select(t => t.Name).First(); } profile.L2VerifyStatusName = profile.L2VerifyStatus.HasValue ? ((VerifyStatus)profile.L2VerifyStatus.Value).ToString() : ""; profile.IdentityDocTypeName = profile.IdentityDocType.HasValue ? ((IdentityDocType)profile.IdentityDocType.Value).ToString() : ""; return(View(profile)); }
private void BindData() { //DataTable dt = DBManager.GetAllUserProfile(txtFilter.Text); UserProfileBLL bll = new UserProfileBLL(); IList <UserProfileInfo> upList = bll.GetAllUserProfile(txtFilter.Text); if (upList != null) { gvUser.DataSource = upList; gvUser.DataBind(); Common.BindBoundControl(upList, this.gvUser, intPageIndex, this.gvUser.PageSize, totalRecordCount); } }
public static string CreateTeamStructure(UserProfileBLL userProfile) { string strUserStatus = ""; try { using (OracleConnection dbCon = ConnectionDB.GetOracleConnection()) { using (OracleCommand oCmd = new OracleCommand()) { oCmd.CommandText = "USER_MANAGEMENT_NEW.DML_TEAM_USERS"; oCmd.CommandType = CommandType.StoredProcedure; oCmd.Connection = dbCon; oCmd.Parameters.Add("PIC_MODULE", OracleDbType.Varchar2, 3, userProfile.ModuleName, ParameterDirection.Input); oCmd.Parameters.Add("PIN_ANLST_UR_ID", OracleDbType.Int32, 10, userProfile.AnalystURID == 0 ? Convert.DBNull : userProfile.AnalystURID, ParameterDirection.Input); oCmd.Parameters.Add("PIN_QUAL_ANLST_UR_ID", OracleDbType.Int32, 10, userProfile.QualityAnalystURID == 0 ? Convert.DBNull : userProfile.QualityAnalystURID, ParameterDirection.Input); oCmd.Parameters.Add("PIN_REV_ANLST_UR_ID", OracleDbType.Int32, 10, userProfile.ReviewerAnalystURID == 0 ? Convert.DBNull : userProfile.ReviewerAnalystURID, ParameterDirection.Input); OracleParameter paStatus = new OracleParameter(); paStatus.ParameterName = "POC_STATUS"; paStatus.Direction = ParameterDirection.Output; paStatus.OracleDbType = OracleDbType.Varchar2; paStatus.Size = 200; oCmd.Parameters.Add(paStatus); dbCon.Open(); oCmd.ExecuteNonQuery(); if (paStatus.Value != null) { if (paStatus.Value.ToString().Length > 0) { strUserStatus = paStatus.Value.ToString(); } else { strUserStatus = Convert.ToString(paStatus.Value); } } dbCon.Close(); } } } catch (Exception ex) { throw ex; } return(strUserStatus); }
private void BindData() { //DataTable dt = DBManager.GetAllExtProp(); UserProfileBLL bll = new UserProfileBLL(); IList <UserProfileExtPropertyInfo> dt = bll.GetAllExtProp(); gvForms.DataSource = dt; gvForms.DataBind(); hfSelectedExtPropID.Value = "-1"; txtProName.Text = string.Empty; txtProDes.Text = string.Empty; txtProCom.Text = string.Empty; }
private void InitUser() { if (!string.IsNullOrEmpty(DeptCode)) { UserProfileBLL bll = new UserProfileBLL(); DataSet ds = bll.GetUserByDeptCode(DeptCode); if (ds != null && ds.Tables.Count > 1) { gvUser.DataSource = ds.Tables[0]; gvUser.DataBind(); txtUserCount.Text = ds.Tables[1].Rows[0][0].ToString(); } } }
/// <summary> /// Create Profile /// </summary> /// <param name="userRole">Object: class reference object of UserProfileBLL</param> /// <returns>string : status message</returns> public static string CreateProfile(UserProfileBLL userRole) { string strUserStatus = ""; try { using (OracleConnection dbCon = ConnectionDB.GetOracleConnection()) { using (OracleCommand oCmd = new OracleCommand()) { oCmd.CommandText = "USER_MANAGEMENT_NEW.SAVE_USER_ROLE"; oCmd.CommandType = CommandType.StoredProcedure; oCmd.Connection = dbCon; oCmd.Parameters.Add("PIN_USER_ID", OracleDbType.Int32, 10, userRole.UserId, ParameterDirection.Input); oCmd.Parameters.Add("PIN_ROLE_ID", OracleDbType.Int32, 10, userRole.RoleId, ParameterDirection.Input); oCmd.Parameters.Add("PIC_MODULE", OracleDbType.Varchar2, 3, userRole.ModuleName, ParameterDirection.Input); OracleParameter paStatus = new OracleParameter(); paStatus.Direction = ParameterDirection.Output; paStatus.OracleDbType = OracleDbType.Varchar2; paStatus.Size = 200; oCmd.Parameters.Add(paStatus); dbCon.Open(); oCmd.ExecuteNonQuery(); if (paStatus.Value != null) { if (paStatus.Value.ToString().Length > 0) { strUserStatus = paStatus.Value.ToString(); } else { strUserStatus = paStatus.Value.ToString(); } } dbCon.Close(); } } } catch (Exception ex) { throw ex; } return(strUserStatus); }
private string GetOrgUsers(HttpContext context) { try { UserProfileBLL bll = new UserProfileBLL(); IList <UserProfileInfo> userInfo = bll.GetAllUserProfile(""); DataTable dt = DataTableExtension.ToDataTable <UserProfileInfo>(userInfo); string Id = context.Request.Form["id"]; string text = context.Request.Form["text"]; return(EasyUIJsonConvert.GetComboBoxJson(dt, Id, text)); } catch (Exception ex) { DBManager.RecoreErrorProfile(ex, "RuleDesignHandler.GetOrgUsers", DBManager.GetCurrentUserAD()); return("Fail"); } }
public ActionResult Verify(Guid id) { var account = FiiiPayDB.UserAccountDb.GetById(id); ViewBag.AccountName = account.PhoneCode + " " + account.Cellphone; var pro = new UserProfileBLL().GetUserProfile(id); var profile = ReflectionHelper.AutoCopy <Entities.UserProfile, UserProfileViewModel>(pro); if (profile.Country.HasValue) { profile.CountryName = FoundationDB.DB.Queryable <Countries>().Where(t => t.Id == profile.Country).Select(t => t.Name).First(); } profile.L2VerifyStatusName = profile.L2VerifyStatus.HasValue ? ((VerifyStatus)profile.L2VerifyStatus.Value).ToString() : ""; profile.IdentityDocTypeName = profile.IdentityDocType.HasValue ? ((IdentityDocType)profile.IdentityDocType.Value).ToString() : ""; ViewBag.VerifyStatusList = GetVerifyStatusList(); return(View(profile)); }
protected void btnDeleteUser_Click(object sender, EventArgs e) { string userIDs = hfSelectedUser.Value; hfSelectedUser.Value = ""; if (userIDs.LastIndexOf(',') == (userIDs.Length - 1)) { userIDs = userIDs.Remove(userIDs.LastIndexOf(',')); } //DBManager.DeleteUserProfile(userIDs, "-1"); UserProfileBLL bll = new UserProfileBLL(); bll.DeleteUserProfile(userIDs); BindData(); }
protected void btnSave_Click(object sender, EventArgs e) { UserProfileBLL bll = new UserProfileBLL(); if (hfSelectedExtPropID.Value != "-1") { //更新记录 //DBManager.UpdateExtPropById(hfSelectedExtPropID.Value, txtProName.Text, txtProDes.Text, txtProCom.Text); bll.UpdateExtPropById(hfSelectedExtPropID.Value, txtProName.Text, txtProDes.Text, txtProCom.Text); } else { //添加记录 //DBManager.AddExtProp(txtProName.Text, txtProDes.Text, txtProCom.Text, Page.User.Identity.Name); bll.AddExtProp(txtProName.Text, txtProDes.Text, txtProCom.Text); } BindData(); }
public async Task <IActionResult> ExternalLoginConfirmation(ExternalLoginViewModel model, string returnUrl = null) { ViewData["Page"] = "external-login-confirmation"; if (ModelState.IsValid) { // Get the information about the user from the external login provider var info = await _signInManager.GetExternalLoginInfoAsync(); if (info == null) { throw new ApplicationException(SiteConfig.generalLocalizer["_error_external_login_information"].Value); } var user = new ApplicationUser { UserName = model.UserName, Email = model.Email, created_at = DateTime.Now, isenabled = 1 }; var result = await SiteConfig.userManager.CreateAsync(user); if (result.Succeeded) { // Init User Profile await UserProfileBLL.InitializeUserProfile(_context, user); // Create Required Directories Directory_Process.CreateRequiredDirectories(SiteConfig.Environment.ContentRootPath + UtilityBLL.ParseUsername(SystemDirectoryPaths.UserDirectory, user.Id.ToString())); result = await SiteConfig.userManager.AddLoginAsync(user, info); if (result.Succeeded) { await _signInManager.SignInAsync(user, isPersistent : false); return(LocalRedirect(returnUrl)); } } AddErrors(result); } ViewData["ReturnUrl"] = returnUrl; return(View("~/Views/Home/index.cshtml", model)); }
public ActionResult Verify(Guid id) { var account = FiiiPayDB.UserAccountDb.GetById(id); ViewBag.AccountName = account.PhoneCode + " " + account.Cellphone; var pro = new UserProfileBLL().GetUserProfile(id); var profile = ReflectionHelper.AutoCopy <Entities.UserProfile, UserProfileViewModel>(pro); profile.IdentityDocTypeName = profile.IdentityDocType.HasValue ? ((IdentityDocType)profile.IdentityDocType.Value).ToString() : ""; ViewBag.VerifyStatusList = GetVerifyStatusList(); var profileSDK = new UserProfileAgent(); int count = profileSDK.GetCountByIdentityDocNo(profile.UserAccountId.Value, pro.IdentityDocNo); ViewBag.IdentityCount = count; return(View(profile)); }
private void LoadDepartmentInfo(string code) { UserProfileBLL bll = new UserProfileBLL(); List <UserDepartmentInfo> infoList = bll.GetDepartmentByUserID(code); ddlDepartment.Items.Clear(); if (infoList != null) { foreach (UserDepartmentInfo info in infoList) { ListItem li = new ListItem(); li.Value = info.DeptCode.ToString(); li.Text = info.DeptName + "(" + info.OrgName + ")"; if (info.IsMain) { li.Selected = true; } ddlDepartment.Items.Add(li); } } }
public JsonResult LoadData(string account, int?countryId, int?status, GridPager pager) { if (!countryId.HasValue) { return(Json(new List <UserProfileViewModel>().ToGridJson(pager))); } var profileList = new UserProfileBLL().GetUserResidencePageList(account, countryId.Value, status, ref pager); if (profileList == null || profileList.Count <= 0) { return(Json(new List <UserProfileViewModel>().ToGridJson(pager))); } var accountIds = profileList.Select(t => t.UserAccountId.Value).ToList(); var countryName = FoundationDB.CountryDb.GetById(countryId).Name; var userList = FiiiPayDB.UserAccountDb.GetList(t => accountIds.Contains(t.Id)); var data = profileList.ToGridJson(pager, r => new { id = r.UserAccountId, cell = new { UserAccountId = r.UserAccountId, Cellphone = userList.Where(t => t.Id == r.UserAccountId).Select(t => t.Cellphone).FirstOrDefault(), FirstName = r.FirstName, LastName = r.LastName, CountryName = countryName, State = r.State, City = r.City, L2VerifyStatus = r.L2VerifyStatus.HasValue ? ((VerifyStatus)r.L2VerifyStatus.Value).ToString() : "", L2SubmissionDate = r.L2SubmissionDate.HasValue ? r.L2SubmissionDate.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm") : "", Remark = r.L2Remark, Options = r.L2VerifyStatus.HasValue ? (int)r.L2VerifyStatus : 0 } }); return(Json(data)); }
public JsonResult LoadData(string cellphone, int?countryId, int?status, GridPager pager) { if (!countryId.HasValue) { return(Json(new List <UserAccountStatus>().ToGridJson(pager))); } var profileList = new UserProfileBLL().GetUserAccountStatusList(cellphone, countryId.Value, status, ref pager); if (profileList == null || profileList.Count <= 0) { return(Json(new List <UserAccountStatus>().ToGridJson(pager))); } var accountIds = profileList.Select(t => t.UserAccountId.Value).ToList(); var countryName = FoundationDB.CountryDb.GetById(countryId).Name; var userList = FiiiPayDB.UserAccountDb.GetList(t => accountIds.Contains(t.Id)); var data = profileList.ToGridJson(pager, r => new { id = r.UserAccountId, cell = new { Id = r.UserAccountId, AccountNo = r.Cellphone, CountryName = countryName, ProfileVerify = r.L1VerifyStatus.ToString(), AddressVerify = r.L2VerifyStatus.ToString(), IsAllowWithdrawal = r.IsAllowWithdrawal, IsAllowAccept = r.IsAllowExpense, Status = (r.Status == 1) ? "Enable" : "Disable", RegisterDate = r.RegistrationDate.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm"), LastLoginDate = r.LastLoginTimeStamp.HasValue ? r.LastLoginTimeStamp.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm") : "" } }); return(Json(data)); }
/// <summary> /// /// </summary> /// <param name="context"></param> /// <returns>>xml拼接字符串</returns> public string DataInfo(HttpContext context) { int i = 0; string filter = string.Empty; string Param = string.Empty; string CheckStyle = "false"; if (!string.IsNullOrEmpty(context.Request["filter"])) { filter = context.Request["filter"].ToString(); } if (!string.IsNullOrEmpty(context.Request["Param"])) { Param = context.Request["Param"].ToString(); } if (!string.IsNullOrEmpty(context.Request["CheckStyle"])) { CheckStyle = context.Request["CheckStyle"].ToString(); if (Convert.ToBoolean(CheckStyle)) { count = Convert.ToInt32(ConfigurationManager.AppSettings["K2EmployeeCheckCountryOne"]); } } StringBuilder xml = new StringBuilder(); UserProfileBLL bll = new UserProfileBLL(); IList <UserProfileInfo> list = bll.GetAllUserProfile(filter); string deptname = ""; string deptcode = Guid.Empty.ToString(); xml.Append("<tr bgcolor='#fef5c7'><th class='th2' style='width:130px;'>员工姓名</th><th class='th1' style='width:130px;'>员工编号 </th><th class='th1' style='width:218px;'>员工邮箱</th> <th class='th1' style='border-right:0px; width:219px;'>员工部门</th> <th class='th1' style='display:none;'>大部门编号</th> <th class='th1' style='display:none;'>中部门编号</th></tr>"); if (list != null && list.Count > 0) { foreach (UserProfileInfo employeeInfo in list) { xml.Append("<tr>"); xml.Append("<td class='mentd1' style='width:130px;'>" + (string.IsNullOrEmpty(employeeInfo.CHName) ? "" : employeeInfo.CHName) + "</td>"); xml.Append("<td class='mentd1' style='width:130px;'>" + (string.IsNullOrEmpty(employeeInfo.ADAccount) ? "" : employeeInfo.ADAccount) + "</td>"); xml.Append("<td class='mentd1'>" + (string.IsNullOrEmpty(employeeInfo.Email) ? "" : employeeInfo.Email) + "</td>"); deptname = "测试部门"; List <UserDepartmentInfo> deptList = bll.GetDepartmentByUserID(employeeInfo.ID.ToString()); if (deptList != null) { UserDepartmentInfo info = deptList.Find(delegate(UserDepartmentInfo tmp) { if (tmp.IsMain) { return(true); } else { return(false); } }); if (info == null) { deptname = "未分配部门"; } else { deptname = info.DeptName; deptcode = info.DeptCode.ToString(); } } else { deptname = "未分配部门"; } xml.Append("<td class='mentd1' style='border-right:0px;'>" + deptname + "</td>"); xml.Append("<td class='mentd1' style='display:none;'>" + deptcode + "</td>"); xml.Append("<td class='mentd1' style='display:none;'>" + (string.IsNullOrEmpty(employeeInfo.WorkPlace) ? "" : employeeInfo.WorkPlace) + "</td>"); xml.Append("<td class='mentd1' style='display:none;'>" + (string.IsNullOrEmpty(employeeInfo.OfficePhone) ? "" : employeeInfo.OfficePhone) + "</td>"); xml.Append("<td class='mentd1' style='display:none;'>" + employeeInfo.ID + "</td>"); xml.Append("</tr>"); if (++i >= count) { break; } } } return(xml.ToString()); }