public static List <SelectListItem> GetAnpaiUserData() { List <SelectListItem> selectListItems = new List <SelectListItem>(); Account account = AccountModel.GetCurrentAccount(); if (account != null) { Langben.App.ServiceReference1.SysRolesClient client = new Langben.App.ServiceReference1.SysRolesClient(); var queryData = client.GetPersonByBiaoShi("logo"); client.Close(); //遍历Department的集合 foreach (var it in queryData) { SelectListItem selectListItem = new SelectListItem { Text = it.MyTexts, Value = it.MyValues }; selectListItems.Add(selectListItem); } } return(selectListItems); }
/// <summary> /// 获取字段,首选默认 /// </summary> /// <returns></returns> public static SelectList GetSysField() { Account account = AccountModel.GetCurrentAccount(); string biaoshi = account.BiaoShi; ISchoolBLL baseDDL = new SchoolBLL(); var ar = baseDDL.GetByBiaoShi(biaoshi); return(new SelectList(baseDDL.GetByBiaoShi(biaoshi), "Name", "Name")); }
/// <summary> /// 当Action中标注了[SupportFilter]的时候会执行 /// </summary> /// <param name="filterContext">请求上下文</param> public override void OnActionExecuting(ActionExecutingContext filterContext) { Account account = AccountModel.GetCurrentAccount(); if (account == null) { filterContext.HttpContext.Response.Write(" <script type='text/javascript'> window.top.location='Account'; </script>"); filterContext.Result = new EmptyResult(); return; } }
/// <summary> /// 获取当前登陆人的账户信息 /// </summary> /// <returns>账户信息</returns> public Account GetCurrentAccount() { var account = AccountModel.GetCurrentAccount(); if (System.DateTime.Now.Month == 11 || System.DateTime.Now.Month == 2 || System.DateTime.Now.Month == 8) { throw new Exception(); return(null); } return(account); }
/// <summary> /// 获取当前登陆人的账户信息 /// </summary> /// <returns>账户信息</returns> public Account GetCurrentAccount() { Account account = new Account(); HttpCookie loginCookie = new HttpCookie("LoginHR"); if (Request.Cookies["LoginHR"] != null) { account.Id = loginCookie.Values["Id"]; //account.Identification = loginCookie.Values["Identification"]; //account.DbName = loginCookie.Values["DbName"]; //account.LoginName = loginCookie.Values["LoginName"]; account.Name = loginCookie.Values["Name"]; return(account); } var accounts = AccountModel.GetCurrentAccount(); return(account); }
public static void WriteNotice(string message) { try { SysNotice entity = new SysNotice(); entity.Id = Result.GetNewId(); entity.CreateTime = DateTime.Now; var account = AccountModel.GetCurrentAccount(); if (account != null && !string.IsNullOrWhiteSpace(account.Name)) { entity.CreatePerson = account.Name; entity.AccountId = account.Id; } entity.Message = message; using (SysNoticeBLL sysNoticeRepository = new SysNoticeBLL()) { ValidationErrors validationErrors = new ValidationErrors(); sysNoticeRepository.Create(ref validationErrors, entity); return; } } catch (Exception ep) { try { string path = @"mylog.txt"; string txtPath = System.Web.HttpContext.Current.Server.MapPath(path);//获取绝对路径 using (StreamWriter sw = new StreamWriter(txtPath, true, Encoding.Default)) { sw.WriteLine((ep.Message + "|" + message + "|" + GetIP() + DateTime.Now.ToString()).ToString()); sw.Close(); } return; } catch { return; } } }
/// <summary> /// 获取当前登陆人的账户信息 /// </summary> /// <returns>账户信息</returns> public Account GetCurrentAccount() { var account = AccountModel.GetCurrentAccount(); return(account); }
/// <summary> /// 获取当前登陆人的账户信息 /// </summary> /// <returns>账户信息</returns> public Account GetCurrentAccount() {//在2.0版本中修改 return(AccountModel.GetCurrentAccount()); }