public ActionResult Register(UserInfo user) { if (CheckValidateCode()) { IUserInfoService userInfoService = new UserInfoService(); user.RoleID = 2; user.RegisterTime = DateTime.Now; user.NiCheng = user.LoginID; user.State = false; Random r = new Random(); user.ActiCode = r.Next(100000, 1000000); UserInfo u = userInfoService.AddEntity(user); if (u != null) { //注册成功 进行邮件验证 验证成功后才可登录 //使用LoginId跟Acticode进行验证 //return RedirectToAction("Index","Home"); //Response.Redirect() //return View(); return Redirect("/Account/Verify"); } else { return Content("0"); } } else { return Content("验证码错误"); } }
public void Add() { UserInfoService userInfoService=new UserInfoService(); UserInfo userInfo = new UserInfo() { DeleteFlag = 1,Email = "*****@*****.**", LoginCode = "ypf", ModifiedDateTime = DateTime.Now, Password = "******" , Remark = "test data", SubmitDateTime = DateTime.Now, UserName = "******", UserStatus = 1 }; Assert.AreEqual(true, userInfoService.Add(userInfo)); }
//权限判断业务逻辑 protected virtual bool AuthorizeCore(ActionExecutingContext filterContext, bool isViewPage) { if (filterContext.HttpContext == null) { throw new ArgumentNullException("httpContext"); } if (!filterContext.HttpContext.User.Identity.IsAuthenticated) { return false;//判定用户是否登录 } //获取当前用户信息 UserInfo user = new UserInfo(); UserInfoService _UserInfoService = new UserInfoService(); user = _UserInfoService.GetKey((filterContext.HttpContext.User.Identity as FormsIdentity).Ticket.UserData.Split("|".ToCharArray())[0]); //var area = filterContext.RouteData.DataTokens["area"]; //var controllerName = filterContext.RouteData.Values["controller"].ToString(); //var actionName = filterContext.RouteData.Values["action"].ToString(); if (isViewPage)//如果当前Action请求为具体的功能页并且不是MasterPage页 { Predicate<SystemMenu> match = delegate(SystemMenu menu) { if ((menu.Code.ToLower()) == area + "." + Controller + "." + Action) return true; else return false; }; SystemMenu has_menu = user.Role.Menu.Find(match); if (has_menu == null) return false; //if (user.Role.Menu(m => m.ControllerName == controllerName && m.ActionName == actionName) == 0) // return false; } else { //var actions = ContainerFactory.GetContainer().Resolve<IAuthorityFacade>().GetAllActionPermission();//所有被维护的Action权限 //if (actions.Count(a => a.ControllerName == controllerName && a.ActionName == actionName) != 0)//如果当前Action属于被维护的Action权限 //{ // if (user.ActionPermission.Count(a => a.ControllerName == controllerName && a.ActionName == actionName) == 0) // return false; //} } return true; }
/// <summary> /// 构造函数 /// </summary> public AccountController() { _UserInfoService = new UserInfoService(); //_AccountService = new AccountService(); }
/// <summary> /// qq授权代理Save /// </summary> private void qqLogin() { string openId = CRequest.GetString("openId"); string accessToken = CRequest.GetString("accessToken"); string nickname = CRequest.GetString("nickname"); UserInfo user = UserInfoService.GetModel(openId, accessToken, 2); if (user == null) { user = new UserInfo(); #region 封装对象进行Join并Log In user.username = ""; user.mobile = ""; user.isBindMobile = 0; user.email = ""; user.isBindEmail = 0; user.password = ""; user.md5Pass = encrypt.EncryptMd5(accessToken); user.relName = nickname; user.bodyCode = openId; user.comName = accessToken; user.pid = 0; user.cid = 0; user.regionId = 0; user.address = ""; user.zipCode = ""; user.qq = ""; user.weixin = ""; user.isBindWeiXin = 0; user.weibo = ""; user.isBindWeiBo = 0; user.shopType = 0; user.shopTypeName = ""; user.imgUrl = ""; user.comInfo = ""; user.remark = ""; user.status = 0; user.addTime = DateTime.Now; user.mobileCode = ""; user.activeCode = ""; user.infoType = 2; int maxId = UserInfoService.Add(user); if (maxId > 0) { user.id = maxId; Session["user"] = user; Response.Write("success"); } else { Response.Write("fail"); } #endregion } else { Session["user"] = user; Response.Write("success"); } }
//获取共享文件 public ActionResult GetShareFile() { int userID = LoginUser.ID; var temp = ShareFileOrNoticeService.LoadEntities(x => x.ID > 0).DefaultIfEmpty().ToList(); int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1; int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 25; int TotalCount = 0; List <ShareFileOrNotice> sfon = new List <ShareFileOrNotice>(); if (temp[0] != null) { #region MyRegion foreach (var a in temp) { if (a.TypeID == 1) { if (a.ShareUser == userID) { sfon.Add(a); continue; } else { Array ay = (a.ShareToUser).Split(','); foreach (var b in ay) { if (b.Equals("")) { continue; } else { int c = Convert.ToInt32(b); if (c == userID) { sfon.Add(a); break; } else { continue; } } } } } else { continue; } } #endregion var iemsfon = sfon.OrderByDescending <ShareFileOrNotice, DateTime?>(u => u.UploadFileTime).Skip <ShareFileOrNotice>((pageIndex - 1) * pageSize).Take <ShareFileOrNotice>(pageSize); sfon = iemsfon.ToList(); List <Sfob> rtsfob = new List <Sfob>(); foreach (var Sf in sfon) { Sfob s = new Sfob(); s.ID = Sf.ID; s.ShareType = Sf.ShareType; s.FileType = Sf.FileType; s.BeiZhu = Sf.BeiZhu; s.FileURL = Sf.FileURL; s.UploadFileTime = Sf.UploadFileTime; s.UserInfo = Sf.UserInfo; s.ShareToUser = Sf.ShareToUser; string eyy = Sf.ShareToUser; var usp = eyy.Split(','); string lname = string.Empty; foreach (var u in usp) { if (u.Length <= 0) { continue; } int uid = Convert.ToInt32(u); lname = lname + UserInfoService.LoadEntities(x => x.ID == uid).FirstOrDefault().PerSonName + ","; } s.alluserinfo = lname; rtsfob.Add(s); } var Rtmp = from d in rtsfob select new { ID = d.ID, TypeID = d.ShareType.Name, FileTypeID = d.FileType.FileTypeCHNName, BeiZhu = d.BeiZhu, FileURL = d.FileURL, UploadFileTime = d.UploadFileTime, ShareUser = d.UserInfo.PerSonName, Sunv = d.ShareToUser, alluserinfo = d.alluserinfo, AddFile = d.UserInfo.ID, shareuserid = LoginUser.ID }; return(Json(new { rows = Rtmp, total = TotalCount }, JsonRequestBehavior.AllowGet)); } return(Json(null, JsonRequestBehavior.AllowGet)); }
public string AddUserFollow(int id, int uid) { return(UserInfoService.AddOrRmUserFollow(id, uid, true)); }
//多商户登录 public ActionResult Logins() { //cid是否只读 int isReadOnly = 0; //登录logo string logo = "/Content/mythemes/default/images/login3/logo.png"; //电话 string phone = Pharos.Utility.Config.GetAppSettings("phone"); var user = new UserLogin(); //二级域名 string d = ""; //二级域名 string dom = ""; if (!RouteData.Values["dom"].IsNullOrEmpty()) { dom = RouteData.Values["dom"].ToString(); } //一级域名 string d1 = ""; if (!RouteData.Values["d1"].IsNullOrEmpty()) { d1 = RouteData.Values["d1"].ToString(); } //顶级域名 string d0 = ""; if (!RouteData.Values["d0"].IsNullOrEmpty()) { d0 = RouteData.Values["d0"].ToString(); } if (!d0.IsNullOrEmpty()) { if (!dom.IsNullOrEmpty()) { d = dom; } } //localhost访问、ip访问 if ((dom.ToLower().Trim() == "localhost") || (dom.IsNullOrEmpty() && d1.IsNullOrEmpty() && d0.IsNullOrEmpty())) { //获取cookie user = setUserLogin(0, user); } //域名访问 else { //API的CID int cID = Authorize.getCID(d); //请求API发生错误 if (cID == -2) { return(error("")); } //输入的二级域名是空 else if (cID == -1) { //return noBusiness(); Response.Redirect("http://www." + dom + "." + d1); return(null); } //输入的域名不存在商户 else if (cID == 0) { return(noBusiness()); } //输入的域名是保留二级域名 else if (cID == -3) { //在crm里面 if (d.ToLower() == "erp") { //获取cookie user = setUserLogin(0, user); } //不在crm里面 else { return(noBusiness()); } } //输入的域名存在商户 else if (cID > 0) { var obj = UserInfoService.Find(o => o.CompanyId == cID); //CID在目前项目不存在 if (obj == null) { return(noUser(cID.ToString())); } else { isReadOnly = 1; user.CID = cID; SysWebSettingBLL bll = new SysWebSettingBLL(); string lg = bll.getLogo(cID); if (!lg.IsNullOrEmpty()) { logo = lg; } //获取cookie user = setUserLogin(cID, user); } } } //cid是否只读 ViewBag.isR = isReadOnly; //登录logo ViewBag.logo = logo; //电话 ViewBag.phone = phone; return(View("Logins", user)); }
/// <inheritdoc /> public void Initialize() { try { var sw = new Stopwatch(); sw.Start(); // init lang if (!Language.Initialize()) { return; } // Получим значение переменной "Тихая загрузка" в первую очередь _quiteLoad = ModPlusAPI.Variables.QuietLoading; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Файла конфигурации может не существовать при загрузке плагина! // Поэтому все, что связанно с работой с файлом конфигурации должно это учитывать! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! var ed = AcApp.DocumentManager.MdiActiveDocument.Editor; if (!CheckCadVersion()) { ed.WriteMessage("\n***************************"); ed.WriteMessage($"\n{Language.GetItem(LangItem, "p1")}"); ed.WriteMessage($"\n{Language.GetItem(LangItem, "p2")}"); ed.WriteMessage($"\n{Language.GetItem(LangItem, "p3")}"); ed.WriteMessage("\n***************************"); return; } Statistic.SendModuleLoaded("AutoCAD", VersionData.CurrentCadVersion); ed.WriteMessage("\n***************************"); ed.WriteMessage($"\n{Language.GetItem(LangItem, "p4")}"); if (!_quiteLoad) { ed.WriteMessage($"\n{Language.GetItem(LangItem, "p5")}"); } // Принудительная загрузка сборок LoadAssemblies(ed); if (!_quiteLoad) { ed.WriteMessage($"\n{Language.GetItem(LangItem, "p6")}"); } LoadBaseAssemblies(ed); if (!_quiteLoad) { ed.WriteMessage($"\n{Language.GetItem(LangItem, "p7")}"); } UserConfigFile.InitConfigFile(); if (!_quiteLoad) { ed.WriteMessage($"\n{Language.GetItem(LangItem, "p8")}"); } LoadFunctions(ed); // check adaptation CheckAdaptation(); // Строим: ленту, меню, плавающее меню // Загрузка ленты Autodesk.Windows.ComponentManager.ItemInitialized += ComponentManager_ItemInitialized; if (ModPlusAPI.Variables.Palette) { MpPalette.CreatePalette(false); } AcApp.SystemVariableChanged += AcAppOnSystemVariableChanged; // Загрузка основного меню (с проверкой значения из файла настроек) FloatMenuCommand.LoadMainMenu(); // Загрузка окна Чертежи MpDrawingsFunction.LoadMainMenu(); // Загрузка контекстных меню для мини-функций MiniFunctions.LoadUnloadContextMenu(); // проверка загруженности модуля автообновления CheckAutoUpdaterLoaded(); // Включение иконок для продуктов var showProductsIcon = bool.TryParse(UserConfigFile.GetValue("mpProductInsert", "ShowIcon"), out var b) && b; // false if (showProductsIcon) { ProductIconCommands.ShowIcon(); } // license server var disableConnectionWithLicenseServerInAutoCad = ModPlusAPI.Variables.DisableConnectionWithLicenseServerInAutoCAD; if (ModPlusAPI.Variables.IsLocalLicenseServerEnable && !disableConnectionWithLicenseServerInAutoCad) { ClientStarter.StartConnection(SupportedProduct.AutoCAD); } if (ModPlusAPI.Variables.IsWebLicenseServerEnable && !disableConnectionWithLicenseServerInAutoCad) { WebLicenseServerClient.Instance.Start(SupportedProduct.AutoCAD); } // user info UserInfoService.ProductStartupAuthorization(); // tooltip hook AcApp.PreTranslateMessage += AutoCadMessageHandler; Autodesk.Windows.ComponentManager.ToolTipOpened += ComponentManager_ToolTipOpened; Autodesk.Windows.ComponentManager.ToolTipClosed += ComponentManager_ToolTipClosed; sw.Stop(); ed.WriteMessage($"\n{Language.GetItem(LangItem, "p9")} {sw.ElapsedMilliseconds}"); ed.WriteMessage($"\n{Language.GetItem(LangItem, "p10")}"); ed.WriteMessage("\n***************************"); } catch (System.Exception exception) { ExceptionBox.Show(exception); } }
public FileResult ExportExcel() { return(File(UserInfoService.ExportToExecl(true, 2), "application/vnd.ms-excel", DateTime.Now.ToString("yyyyMMdd") + ".xls")); }
public ApplyController(PostService.PostService postService, UserInfoService userInfoService, ApplyService.ApplyService applyService) { _postService = postService; _applyService = applyService; _userInfoService = userInfoService; }
public HomeController(ILogger <HomeController> logger, UserInfoService userInfoService) { _logger = logger; _userInfoService = userInfoService; }
public AdminUserInfoController(UserInfoService userInfoService , UserStatuService userStatuService) : base(userStatuService) { this._userInfoService = userInfoService; }
/// <summary> /// 绑定信息 /// </summary> private void BindData() { Product item = ProductService.GetModel(id); if (item != null) { UserInfo user = UserInfoService.GetModel(item.useId); if (user != null) { ViewState["shoperId"] = user.id; ViewState["shoperName"] = user.comName; } ViewState["proName"] = item.proName; ViewState["proDesc"] = item.proDesc; ViewState["advantage"] = item.advantage; ViewState["productType"] = item.productType; StringBuilder sb = new StringBuilder(); if (item.detailImg1 != "") { sb.Append("<li><img src=\"" + item.detailImg1 + "\" alt=\"" + item.proName + "\"/></li>"); } if (item.detailImg2 != "") { sb.Append("<li><img src=\"" + item.detailImg2 + "\" alt=\"" + item.proName + "\"/></li>"); } if (item.detailImg3 != "") { sb.Append("<li><img src=\"" + item.detailImg3 + "\" alt=\"" + item.proName + "\"/></li>"); } if (item.detailImg4 != "") { sb.Append("<li><img src=\"" + item.detailImg4 + "\" alt=\"" + item.proName + "\"/></li>"); } ViewState["imgInfo"] = sb.ToString(); if (sb.ToString().Length == 0) { ViewState["noImg"] = item.listImgUrl; } StringBuilder sb2 = new StringBuilder(); sb = new StringBuilder(); sb.Append("<ul>"); if (item.unit1 != "") { sb.Append("<li id=\"price1\">" + item.unit1 + "</li>"); sb2.Append("<div class=\"rmb\">$ <span>" + item.price1.ToString("0.00") + "</span></div>"); } sb.Append("</ul>"); ViewState["unitInfo"] = sb.ToString(); ViewState["priceInfo"] = sb2.ToString(); ViewState["productContent"] = item.proContent; //相关产品 DataSet ds = ProductService.GetList(16, "productType = " + item.productType, "id"); if (ds.Tables[0].Rows.Count > 0) { repXG.DataSource = ds; repXG.DataBind(); } } }
public ActionResult Edit(UserInfo user) { UserInfoService.Update(user); return(Content("OK")); }
public ActionResult Edit(int id) { ViewData.Model = UserInfoService.GetEntities(u => u.ID == id).FirstOrDefault(); return(View()); }
private bool SelectUserName(UserInfo Uinfo) { return(UserInfoService.LoadEntities(x => x.UName == Uinfo.UName).FirstOrDefault() != null); }
/// <summary> /// 获取Text Verification Code /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtnGetCode_Click(object sender, EventArgs e) { // lbtnGetCode.Text = ""; string mobile = this.tel.Text.Trim(); if (mobile.Length == 0) { ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('Phone Can not Be Blank!');", true); return; } if (mobile.Length != 10) { ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('Wrong mobile number input!');", true); return; } if (UserInfoService.ExistsMobile("1" + mobile)) { ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('This phone number has already joined.');", true); return; } mobile = "1" + mobile; ViewState["time"] = null; Timer1.Enabled = true; Timer1.Interval = 1000; Random ran = new Random(); int num = ran.Next(105000, 999999); MessageCode item = new MessageCode(); item.mobile = mobile; item.code = num.ToString(); item.status = 0; item.remark = ""; item.addTime = DateTime.Now; item.infoType = 1; int maxId = MessageCodeService.Add(item); if (maxId > 0) { IClientProfile profile = Aliyun.Acs.Core.Profile.DefaultProfile.GetProfile(regionIdForPop, accessId, accessSecret); Aliyun.Acs.Core.Profile.DefaultProfile.AddEndpoint(regionIdForPop, regionIdForPop, product, domain); IAcsClient acsClient = new DefaultAcsClient(profile); SendSmsRequest request = new SendSmsRequest(); try { //request.SignName = "上云预发测试";//"管理控制台中配置的短信签名(状态必须是验证通过)" //request.TemplateCode = "SMS_71130001";//管理控制台中配置的审核通过的短信模板的模板CODE(状态必须是验证通过)" //request.RecNum = "13567939485";//"接收号码,多个号码可以逗号分隔" //request.ParamString = "{\"name\":\"123\"}";//短信模板中的变量;数字需要转换为字符串;个人用户每个变量长度必须小于15个字符。" //SingleSendSmsResponse httpResponse = client.GetAcsResponse(request); request.PhoneNumbers = mobile; request.SignName = "PlateX"; request.TemplateCode = "SMS_188556279"; request.TemplateParam = "{\"code\":\"" + num + "\"}"; request.OutId = DateTime.Now.ToString("yyyyMMddHHmmss"); //"xxxxxxxx"; //请求失败这里会抛ClientException异常 SendSmsResponse sendSmsResponse = acsClient.GetAcsResponse(request); string mess = sendSmsResponse.Message; //Response.Write(mess); System.Console.WriteLine(mess); ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('Verification Code send ok!');", true); } catch (ServerException je) { ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('Verification Code Send Fail!');", true); //System.Console.WriteLine("ServerException"); } catch (ClientException ne) { ScriptManager.RegisterStartupScript(UpdatePanel1, GetType(), "", "alert('Verification Code Send Fail!');", true); } } }
public EditorDevoteListController(UserInfoService userInfoService, WikiPassageService wikiPassageService) { _userInfoService = userInfoService; _wikiPassageService = wikiPassageService; }
LoginController() { rsp = new HttpResponseMessage(); _service = new UserInfoService(); }
public JsonResult CheckUserName(string username) { var reslut = UserInfoService.GetEntities(u => u.UserInfoLoginId.Equals(username)).AsQueryable().Count() == 0; return(Json(reslut, JsonRequestBehavior.AllowGet)); }
public JsonResult getUser( string pageSize, string name, string page, string username, string password, string phone, string sex, string isSys) { List <UserUserInfo> uuiList = UserUserInfoService.LoadEntities(t => true).ToList(); List <UserUserInfoEntity> entity = new List <UserUserInfoEntity>(); foreach (UserUserInfo item in uuiList) { User user = UserService.LoadEntities(u => u.uid == item.uid).FirstOrDefault(); UserInfo userInfo = UserInfoService.LoadEntities(u => u.uiid == item.uiid).FirstOrDefault(); entity.Add(new UserUserInfoEntity { uid = user.uid, uiid = userInfo.uiid, username = user.username, password = user.password, name = userInfo.name, sex = userInfo.sex, phone = userInfo.phone, isSys = user.isSys }); } int pageInt = Convert.ToInt32(page); int pageSizeInt = Convert.ToInt32(pageSize); if (!string.IsNullOrEmpty(name)) { entity = entity.Where(u => u.name.Contains(name)).ToList(); } if (!string.IsNullOrWhiteSpace(username)) { entity = entity.Where(u => u.username.Contains(username)).ToList(); } if (!string.IsNullOrWhiteSpace(isSys)) { entity = entity.Where(u => u.isSys == isSys).ToList(); } if (!string.IsNullOrWhiteSpace(password)) { entity = entity.Where(u => u.password.Contains(password)).ToList(); } if (!string.IsNullOrWhiteSpace(sex)) { entity = entity.Where(u => u.sex == sex).ToList(); } if (!string.IsNullOrWhiteSpace(phone)) { entity = entity.Where(u => u.phone.Contains(phone)).ToList(); } int total = entity.Count; entity = entity.Skip((pageInt - 1) * pageSizeInt).Take(pageSizeInt).ToList(); return(Json(new { entity = entity, total = total }, JsonRequestBehavior.AllowGet)); }
public void TestGET() { UserInfoService userInfo = new UserInfoService(); }
public JsonResult getOrders(string pageSize, string page, string name, string oid, string community, string area, string unitType, string duration, string rent, string floor, string time, string state ) { List <OrdersUserHouse> ouhList = OrdersUserHouseService.LoadEntities(o => true).ToList(); List <OrdersUserHouseEntity> entity = new List <OrdersUserHouseEntity>(); foreach (OrdersUserHouse item in ouhList) { Orders orders = OrdersService.LoadEntities(o => o.oid == item.oid).FirstOrDefault(); User user = UserService.LoadEntities(o => o.uid == item.uid).FirstOrDefault(); int uiid = UserUserInfoService.LoadEntities(u => u.uid == user.uid).FirstOrDefault().uiid; UserInfo userInfo = UserInfoService.LoadEntities(u => u.uiid == uiid).FirstOrDefault(); House house = HouseService.LoadEntities(h => h.hid == item.hid).FirstOrDefault(); entity.Add(new OrdersUserHouseEntity() { name = userInfo.name, phone = userInfo.phone, duration = orders.duration, rent = orders.rent, state = orders.state, time = orders.time, ouhid = item.ouhid, hid = house.hid, community = house.community, unitType = house.unitType, area = house.area, oid = orders.oid, floor = house.floor }); } int pageInt = Convert.ToInt32(page); int pageSizeInt = Convert.ToInt32(pageSize); if (!string.IsNullOrWhiteSpace(state)) { //int oidInt = Convert.ToInt32(oid); entity = entity.Where(u => u.state == state).ToList(); } //time = time.Replace("-",""); // 20210326 if (!string.IsNullOrWhiteSpace(time)) { time = time.Substring(0, 10).Replace("-", ""); DateTime itemDate = DateTime.ParseExact(time, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture); itemDate = itemDate.AddDays(1); string formatDate = itemDate.ToString("yyyyMMdd"); //int oidInt = Convert.ToInt32(oid); entity = entity.Where(u => u.time == formatDate).ToList(); } if (!string.IsNullOrWhiteSpace(oid)) { int oidInt = Convert.ToInt32(oid); entity = entity.Where(u => u.oid == oidInt).ToList(); } if (!string.IsNullOrWhiteSpace(area)) { int areaInt = Convert.ToInt32(area); entity = entity.Where(u => u.area == areaInt).ToList(); } if (!string.IsNullOrWhiteSpace(duration)) { int durationInt = Convert.ToInt32(duration); entity = entity.Where(u => u.duration == durationInt).ToList(); } if (!string.IsNullOrWhiteSpace(rent)) { int rentInt = Convert.ToInt32(rent); entity = entity.Where(u => u.rent == rentInt).ToList(); } if (!string.IsNullOrWhiteSpace(name)) { entity = entity.Where(u => u.name.Contains(name)).ToList(); } if (!string.IsNullOrWhiteSpace(community)) { entity = entity.Where(u => u.community.Contains(community)).ToList(); } if (!string.IsNullOrWhiteSpace(unitType)) { entity = entity.Where(u => u.unitType.Contains(unitType)).ToList(); } if (!string.IsNullOrWhiteSpace(floor)) { entity = entity.Where(u => u.floor.Contains(floor)).ToList(); } int total = entity.Count; entity = entity.Skip((pageInt - 1) * pageSizeInt).Take(pageSizeInt).ToList(); return(Json(new { entity = entity, total = total }, JsonRequestBehavior.AllowGet)); }
public object SelUserFollow(int id) { return(UserInfoService.SelUserFollow(id)); }
public IHttpActionResult Post([FromBody] Request <TreatmentRequest> request) { try { IList <FileUpload> files = request.Data.files; UserEvent u = request.Data.userEvent; string eventID = u.EventID; string newEventID = Guid.NewGuid().ToString(); UserEvent userEvent = bll.Get(p => p.EVENTID.Equals(eventID)); UserEvent serviceEvent = bll.Get(p => p.REMARKS == eventID && p.USERAPPLYID == userEvent.UserApplyId && p.ACTIONSTATUS == "1"); if (userEvent == null) { return(BadRequest("该记录不存在!")); } //更新文件列表 FileUploadBLL fileBLL = new FileUploadBLL(); string fromUser = userEvent.ToUser; foreach (FileUpload item in files) { item.FormId = newEventID; fileBLL.Edit(item); } userEvent.Remarks = u.Remarks; userEvent.ActionType = "1"; userEvent.ActionStatus = ((int)ActionStatus.Complete).ToString(); userEvent.EndTime = DateTime.Now; bool result = bll.Edit(userEvent); #region 结束客服待办 if (serviceEvent != null) { serviceEvent.ActionStatus = ((int)ActionStatus.Complete).ToString(); serviceEvent.EndTime = DateTime.Now; bll.Edit(serviceEvent); } #endregion if (result) { UserInfo currentUser = new UserInfoService().GetCurrentUser(); string _name = currentUser == null ? "" : currentUser.LoginName; UserEvent newUEvent = new UserEvent(); newUEvent.EventID = newEventID; newUEvent.UserApplyId = userEvent.UserApplyId; newUEvent.FromUser = fromUser; newUEvent.ActionType = ((int)ActionType.待办事项).ToString(); newUEvent.ActionInfo = string.Format("您收到了用户{0}上传的病历资料,请整理", _name); newUEvent.ReceiptTime = DateTime.Now; newUEvent.ActionStatus = ((int)ActionStatus.Progress).ToString(); newUEvent.CreateTime = DateTime.Now; newUEvent.LinkUrl = "UserArrange"; bll.AddUserEvent(newUEvent, UserType.医学编辑); } return(Ok("ok")); } catch (Exception ex) { LogService.WriteErrorLog("DoTreatmentController[Post]", ex.ToString()); return(BadRequest(ex.ToString())); } }
//获取当前用户所有模型 public ActionResult GetAllModel() { var uid = LoginUser.ID; var temp = ShareFileOrNoticeService.LoadEntities(x => x.ShareUser == uid && x.TypeID == 1).DefaultIfEmpty().ToList(); List <ModelSF> list = new List <ModelSF>(); if (temp.Count != 0 && temp[0] != null) { foreach (var a in temp) { if (list.Count != 0) { int g = 0; if (a == null || a.ModelList == "") { continue; } for (int i = 0; i < list.Count; i++) { if (list[i] == null) { continue; } if (a.ModelList == list[i].StrID) { g = 1; } } if (g == 1) { continue; } ModelSF msf = new ModelSF(); msf.StrID = a.ModelList; var str = (a.ModelList).Split(','); var strs = ""; foreach (var c in str) { if (c == "") { continue; } var b1 = Convert.ToInt32(c); var u = UserInfoService.LoadEntities(x => x.ID == b1).FirstOrDefault(); strs = strs + u.PerSonName + ","; } msf.StrName = strs; list.Add(msf); } else { if (a == null || a.ModelList == "") { continue; } ModelSF msf = new ModelSF(); msf.StrID = a.ModelList; var str = (a.ModelList).Split(','); var strs = ""; foreach (var b in str) { if (b == "") { continue; } var b1 = Convert.ToInt32(b); var u = UserInfoService.LoadEntities(x => x.ID == b1).FirstOrDefault(); strs = strs + u.PerSonName + ","; } msf.StrName = strs; list.Add(msf); } } return(Json(list, JsonRequestBehavior.AllowGet)); } else { return(Json(null, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 构造函数 /// </summary> public HomeController() { _UserInfoService = new UserInfoService(); }
private ExtUserEvent GetExtData(UserEvent userEvent) { ExtUserEvent extUserEvent = new ExtUserEvent(); extUserEvent.EventID = userEvent.EventID; extUserEvent.ActionStatus = userEvent.ActionStatus; extUserEvent.Remarks = userEvent.Remarks; List <UserEvent> tracks = bll.GetList(p => p.USERAPPLYID.Equals(userEvent.UserApplyId)).OrderBy(p => p.CreateTime).ToList(); UserInfoService userService = new UserInfoService(); UserRoleBLL userRoleBLL = new UserRoleBLL(); RoleBLL roleBLL = new RoleBLL(); for (int i = 0; i < tracks.Count; i++) { string _userID = tracks[i].ToUser; UserInfo userInfo = userService.GetUserInfoByID(_userID); if (userInfo == null) { tracks[i].ToUser = ""; } else { tracks[i].ToUser = userInfo.LoginName; } UserRole userrole = userRoleBLL.GetOne(p => p.USERID.Equals(_userID)); if (userrole == null) { tracks[i].Remarks = ""; } else { Role role = roleBLL.Get(userrole.RoleID); tracks[i].Remarks = role == null ? "" : role.RoleName; } } //todo:20160119演示用,临时去了客服的代办信息 extUserEvent.Tracks = tracks.Where(p => !p.Remarks.Contains("客服")).ToList(); //extUserEvent.Tracks = tracks; DoctorControlBll dcBLL = new DoctorControlBll(); UserApply userApply = dcBLL.GetModelUserApply(userEvent.UserApplyId); if (userApply != null) { extUserEvent.DoctorSuggest = userApply.DOCTORSUGGEST; GuideLineBLL gdBLL = new GuideLineBLL(); GuideLine guidline = gdBLL.GetSimpleModel(userApply.CURRENTNODE); if (guidline != null) { extUserEvent.CurrentNodeName = guidline.Name; extUserEvent.RecommendProcess = guidline.RecommendProcess; } } EventProductBLL epdBLL = new EventProductBLL(); extUserEvent.Products = epdBLL.GetList(p => p.EVENTID.Equals(userEvent.EventID)).ToList(); return(extUserEvent); }
public IQueryable <ActiveEvent> MyDay([FromBody] CalendarDayRequestModel model) { var converter = new CourseConverter(Db); var userService = new UserInfoService(); var user = userService.GetUser(model.userid); var from = model.date.Date; var until = from.AddDays(1); var list = new List <ActiveEvent>(); var allDates = Db.ActivityDates.Where(x => (x.Activity.Occurrence.Subscriptions.Any(s => !string.IsNullOrEmpty(s.UserId) && s.UserId.Equals(user.Id)) || x.Hosts.Any(m => !string.IsNullOrEmpty(m.UserId) && m.UserId.Equals(user.Id)) ) && x.Begin >= from && x.End <= until).ToList(); foreach (var activityDate in allDates) { var calendarDate = new ActiveEvent(); calendarDate.course = activityDate.Activity.Name; calendarDate.starttime = activityDate.Begin; calendarDate.endtime = activityDate.End; var sb = new StringBuilder(); foreach (var host in activityDate.Hosts) { sb.Append(host.Name); if (host != activityDate.Hosts.Last()) { sb.Append(", "); } } calendarDate.teacher = sb.ToString(); sb.Clear(); foreach (var room in activityDate.Rooms) { sb.Append(room.Number); if (room != activityDate.Rooms.Last()) { sb.Append(", "); } } calendarDate.room = sb.ToString(); sb.Clear(); foreach (var virtualRoom in activityDate.VirtualRooms) { sb.Append(virtualRoom.Room.Name); if (virtualRoom != activityDate.VirtualRooms.Last()) { sb.Append(", "); } } calendarDate.virtual_room = sb.ToString(); sb.Clear(); if (activityDate.Occurrence.IsCanceled) { calendarDate.special = "X"; } if (activityDate.Activity is Course course) { calendarDate.moodle = course.UrlMoodleCourse; calendarDate.moodle_key = course.KeyMoodleCourse; } list.Add(calendarDate); } return(list.AsQueryable()); }
protected void Page_Load(object sender, EventArgs e) { //测试 int id; #region 如果用户登录了,将用户信息绑定 //如果用户登录了,将用户信息绑定 if (Session["User_Name"] != null) { BindAcg(); BindComments(); BingLeavewords(); SqlDataReader dt = UserInfoService.users(int.Parse(Session["User_ID"].ToString())); dt.Read(); if (dt != null) { User_Name.Text = dt[1].ToString(); User_Email.Text = dt[4].ToString(); User_Password.Text = dt[2].ToString(); User_Phone.Text = dt[5].ToString(); User_Img.ImageUrl = dt[3].ToString(); } } #endregion if (!IsPostBack) { try { #region Acg投稿数据绑定和删除 if (Request.QueryString["proid"] != null) { id = Convert.ToInt32(Request.QueryString["proid"].ToString()); if (AcgService.delete(id) == 1) { BindAcg(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除删除失败!');</script>"); } } #endregion #region 用户评论数据绑定和删除 if (Request.QueryString["commentsid"] != null) { id = Convert.ToInt32(Request.QueryString["commentsid"].ToString()); if (CommentService.usersDelete(id) == 1) { BindComments(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除删除失败!');</script>"); } } #endregion #region 用户回复数据绑定和删除 if (Request.QueryString["Leavewordsid"] != null) { id = Convert.ToInt32(Request.QueryString["Leavewordsid"].ToString()); if (LeavewordsService.usersDelete(id) == 1) { BingLeavewords(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除删除失败!');</script>"); } } #endregion } catch (Exception ex) { } } }