public void Answer_Submit(string quest, string answer, string newanswer) { if (!B_User.CheckIsLogged(Request.RawUrl)) { return; } if (string.IsNullOrEmpty(newanswer) || string.IsNullOrEmpty(answer)) { function.WriteErrMsg("安全问题与答案不能为空"); return; } else if (!mu.Question.Equals(quest)) { function.WriteErrMsg("安全问题不正确"); return; } else if (!mu.Answer.Equals(answer)) { function.WriteErrMsg("问题答案不正确"); return; } else { mu.Answer = newanswer; buser.UpdateByID(mu); function.WriteSuccessMsg("修改安全问题成功", "/User/Info/"); return; } }
public void Pwd_Edit() { B_User.CheckIsLogged(Request.RawUrl); M_UserInfo mu = buser.GetLogin(false); string oldPwd = StringHelper.MD5(Request.Form["TxtOldPassword"]); string newPwd = Request.Form["TxtPassword"]; string cnewPwd = Request.Form["TxtPassword2"]; if (!mu.UserPwd.Equals(oldPwd)) { function.WriteErrMsg("原密码错误,请重新输入"); return; } if (StrHelper.StrNullCheck(newPwd, cnewPwd)) { function.WriteErrMsg("新密码与确认密码不能为空"); return; } if (!newPwd.Equals(cnewPwd)) { function.WriteErrMsg("新密码与确认密码不匹配"); return; } if (newPwd.Length < 6) { function.WriteErrMsg("密码最少需要6位"); return; } mu.UserPwd = StringHelper.MD5(newPwd); buser.UpdateByID(mu); buser.ClearCookie(); function.WriteSuccessMsg("修改密码成功,请重新登录", "/User/"); return; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { B_User.CheckIsLogged(Request.RawUrl); M_UserInfo mu = buser.GetLogin(); int appid = DataConverter.CLng(Request.QueryString["appid"]); string err = ""; if (!B_User.CheckUserStatus(mu, ref err)) { function.WriteErrMsg(err); } uappMod = uappBll.SelModelByUid(mu.UserID, "wechat"); if (uappMod != null) { function.WriteErrMsg("您已经绑定了微信公众号,不能重复绑定!"); } else { if (appid > 0) { bind_img.Src = "/Common/Common.ashx?url=" + HttpUtility.UrlEncode("http://banjiuw.com/wxpromo.aspx?bindid=" + mu.UserID + "&appid=" + appid); } else { bind_img.Src = "/Common/Common.ashx?url=" + SiteConfig.SiteInfo.SiteUrl + "/wxpromo.aspx?bindid=" + mu.UserID; } } } }
public ActionResult GetSubmitDetails(long zyId, int schoolId, int gradeId, int classId) { int id = IdNamingHelper.Decrypt(IdNamingHelper.IdTypeEnum.Zy, zyId); List <dto_StudentPoint> list = B_Analyze.GetStudentPoint2(id, schoolId, gradeId, classId); List <T_User> list2 = B_User.GetClassmates(schoolId, gradeId, classId); if (list != null) { foreach (var l in list) { T_User u = list2.Find(a => a.Id == l.StudentId); if (u == null) { l.UserName = ""; l.TrueName = "试用学生"; } else { l.UserName = u.UserName; l.TrueName = u.TrueName; } l.NewId = zyId; l.ZyId = 0; list2.RemoveAll(a => a.Id == l.StudentId); } } ViewBag.List = list; ViewBag.List2 = list2.Select(a => a.UserName + "【" + a.TrueName + "】").ToList(); return(PartialView()); }
public bool UpdateIServer() { int id = int.Parse(lblQuestionId.Text.ToString()); M_IServer iserver = serverBll.SeachById(id); B_User buser = new B_User(); iserver.UserId = buser.GetUserByName(hfusername.Value.Trim()).UserID; iserver.State = DropDownList1.SelectedValue.ToString(); iserver.Priority = DropDownList2.SelectedValue.ToString(); iserver.Root = DropDownList3.SelectedValue.ToString(); iserver.Type = DropDownList4.SelectedValue.ToString(); iserver.ReadCount = int.Parse(lblReadCount.Text.ToString()); iserver.SubTime = DataConverter.CDate(lblSubTime.Text.ToString()); if (DropDownList1.SelectedValue.ToString().Equals("已解决")) { iserver.SolveTime = DateTime.Now; } else { if (lblSolveTime.Text.ToString() == "") { iserver.SolveTime = DateTime.MinValue; } else { iserver.SolveTime = DataConverter.CDate(lblSolveTime.Text.ToString()); } } return(serverBll.Update(iserver)); }
public string GetUserName(string UserID) { B_User buser = new B_User(); string uname = buser.SeachByID(DataConverter.CLng(UserID)).UserName; return(uname == "" ? "[匿名]" : uname); }
/// <summary> /// 获取关注老师的作业 /// </summary> /// <param name="lastId"></param> /// <param name="count"></param> /// <returns></returns> public ActionResult GetRelatedUserZy(long lastId, int count) { int last = lastId == 0 ? 99999999 : IdNamingHelper.Decrypt(IdNamingHelper.IdTypeEnum.Zy, lastId); int[] RUsers = B_User.GetRelatedUser(UserId); List <dto_Zy> list = B_Zy.GetZyList(RUsers, last, count); if (list != null) { List <int> ids = B_Answer.GetSubmitedZyIds(UserId, list.Select(a => a.Id).ToArray()); foreach (var l in list) { l.NewId = IdNamingHelper.Encrypt(IdNamingHelper.IdTypeEnum.Zy, l.Id); string subName = ""; Const.Subjects.TryGetValue(l.SubjectId, out subName); l.SubjectName = subName; l.TypeName = l.Type == 0 ? "题库" : "自传"; dto_User u = B_UserRedis.GetUser(l.UserId); l.UserName = u.UserName; l.TrueName = u.TrueName; l.Submited = ids == null ? false : ids.Exists(a => a == l.Id); //隐藏真实Id l.Id = 0; } } ViewBag.RelateUserCount = RUsers == null ? 0 : RUsers.Length; ViewBag.ZyList = list; return(PartialView()); }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(Request.RawUrl); mu = buser.GetLogin(); if (!IsPostBack) { if (TlpID > 0) { desMod = desBll.SelReturnModel(TlpID); if (desMod == null || desMod.ZType != 1) { function.WriteErrMsg("模板不存在"); } } if (Mid > 0) { desMod = desBll.SelReturnModel(Mid); if (desMod == null) { function.WriteErrMsg("目标不存在"); } if (desMod.UserID != mu.UserID) { function.WriteErrMsg("你无权修改"); } } if (desMod == null) { function.WriteErrMsg("未指定信息"); } function.Script(this, "fabHelper.init(" + StrHelper.DecompressString(desMod.LogoContent) + ");"); } }
//传入ID才可修改最新的词条 public ActionResult BKEditor() { switch (Mode) { case "admin": if (!B_Admin.CheckIsLogged(Request.RawUrl)) { return(null); } break; case "user": default: //是否限定创建权限,用户所在组是否拥有创建权限 B_User.CheckIsLogged(Request.RawUrl); if (!bkBll.AuthCheck(GuestConfig.GuestOption.BKOption.CreateBKGroup, mu.GroupID)) { function.WriteErrMsg("你没有创建或编辑词条的权限"); return(null); } break; } M_Baike bkMod = GetModel_Editor(ref err); if (!string.IsNullOrEmpty(err)) { function.WriteErrMsg(err); return(null); } if (bkMod == null) { bkMod = new M_Baike(); } return(View(bkMod)); }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(); if (!IsPostBack) { M_FastOrder model = new M_FastOrder() { ProUrl = Request["ProUrl"], ProName = Request["ProName"], ProSeller = Request["ProSeller"], Price = Convert.ToDouble(Request["Price"]), Pronum = DataConverter.CLng(Request["Pronum"]), ProClass = DataConverter.CLng(Request["ProClass"]), Proinfo = Request["Proinfo"], Phone = Request["Phone"], Attribute = Request["Attribute"] }; model.Pronum = model.Pronum < 1 ? 1 : model.Pronum; if (model.Price < 0) { function.WriteErrMsg("金额不正确"); } CreateOrder(model); } }
//结算,到订单页再生成AllMoney protected void NextStep_Click(object sender, EventArgs e) { //AJAX就先检测一遍,未登录则弹窗 B_User.CheckIsLogged(Request.RawUrl); M_UserInfo mu = buser.GetLogin(); //提交前同步一次,避免即时登录造成的cart中id未与用户关联 CartDT = cartBll.SelByCartID(CartCookID, mu.UserID, ProClass); //从数据库中获取 //获取所有购物车的记录,更新信息 for (int i = 0; i < CartDT.Rows.Count; i++) { // //Additional {\"age\":\"\",\"weight\":\"\",\"type\":\"\"} DataRow dr = CartDT.Rows[i]; string id = dr["id"].ToString(); dr["Additional"] = JsonHelper.GetJson( new string[] { "age", "weight", "type" }, new string[] { Request.Form["age_" + id], Request.Form["weight_" + id], Request.Form["type_" + id] }); dr["UserID"] = mu.UserID; string set = "UserID=" + mu.UserID + ",Additional=@addon"; List <SqlParameter> sp = new List <SqlParameter>() { new SqlParameter("addon", dr["Additional"].ToString()) }; DBCenter.UpdateSQL("ZL_Cart", set, "ID=" + dr["ID"], sp); } string ids = Request.Form["prochk"]; Response.Redirect("GetOrderInfo.aspx?ids=" + ids + "&ProClass=" + ProClass);//"#none" }
protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "event": B_User buser = new B_User(); M_UserInfo mu = buser.GetLogin(); if (mu == null || mu.UserID < 1) { mu = buser.GetUserByName(badmin.GetAdminLogin().UserName); buser.SetLoginState(mu); } if (mu == null || mu.UserID < 1) { function.WriteErrMsg("你还没有绑定用户,请绑定用户后再发起聊天"); } ZLEvent.AddEvent(new M_ZLEvent() { MyType = ZLEvent.EventT.UAction, Name = e.CommandArgument.ToString(), Value = "{\"action\":\"chat\",\"uid\":\"" + mu.UserID + "\"}" }); function.Script(this, "GetTo('" + e.CommandArgument + "');"); break; } }
public JsonResult SearchUser(string keyWords) { List <T_User> list = B_User.SearchUser(keyWords, UserId); if (list == null) { return(Json(new List <dto_User>())); } int[] uIds = list.Select(a => a.Id).ToArray(); List <T_UserExtend> uel = B_User.GetUserExtends(uIds); List <dto_User> ul = new List <dto_User>(); foreach (var l in list) { string gName = ""; Const.Grades.TryGetValue(l.GradeId, out gName); T_UserExtend ue = uel == null ? null : uel.Find(a => a.UserId == l.Id); ul.Add(new dto_User() { Id = l.Id, UserName = l.UserName, TrueName = l.TrueName, SchoolName = B_Base.GetSchool(l.SchoolId).SchoolName, GradeName = gName == null ? "" : gName, ClassName = l.ClassId + "班", Locked = ue == null ? false : ue.Locked }); } return(Json(ul)); }
public ActionResult AddApproval() { if (!B_User.CheckIsLogged()) { return(null); } ViewBag.inputer = mu.UserName; int ID = DataConverter.CLng(Request["ID"]); DataTable types = mtBll.Sels(); List <SelectListItem> nodeList = new List <SelectListItem>(); nodeList.Add(new SelectListItem { Text = "全部", Value = "0" }); foreach (DataRow row in types.Rows) { nodeList.Add(new SelectListItem { Text = row.Field <string>("TypeName"), Value = row.Field <int>("ID").ToString() }); } ViewBag.types = nodeList; ViewBag.pros = mpBll.Sel(); DataTable dt = maBll.Sel(ID); if (dt.Rows.Count > 0) { ViewBag.content = dt.Rows[0]["Content"].ToString(); ViewBag.approver = dt.Rows[0]["Approver"].ToString(); ViewBag.results = dt.Rows[0]["Results"].ToString(); } return(View()); }
protected void UpPlat_B_Click(object sender, EventArgs e) { M_UserInfo mu = buser.SelReturnModel(UserID); M_User_Plat upMod = upBll.SelReturnModel(UserID); M_Plat_Comp compMod = new M_Plat_Comp(); B_Plat_Comp compBll = new B_Plat_Comp(); if (upMod == null) { //------------------------------------ upMod = new M_User_Plat(); upMod.UserID = mu.UserID; upMod.TrueName = B_User.GetUserName(mu.HoneyName, mu.TrueName, mu.UserName); upMod.Post = ""; upMod.Status = 1; //---------------------------------------- compBll.CreateByUser(upMod); upBll.Insert(upMod); } else { if (upMod.CompID == 0)//兼容之前的逻辑 { compBll.CreateByUser(upMod); } upMod.Status = 1; upBll.UpdateByID(upMod); } ShowPlatInfo(upMod.UserID); function.WriteSuccessMsg("操作成功,你现在可以为该用户指定公司"); }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(Request.RawUrl); if (!IsPostBack) { M_Payment payMod = new M_Payment(); DataTable orderDT = new DataTable(); purseli.Visible = SiteConfig.SiteOption.SiteID.Contains("purse"); siconli.Visible = SiteConfig.SiteOption.SiteID.Contains("sicon"); pointli.Visible = SiteConfig.SiteOption.SiteID.Contains("point"); if (Money > 0)//直接传要充多少,用于充值余额等,生成一条临时记录 { virtual_ul.Visible = false; orderDT = orderBll.GetOrderbyOrderNo("-1"); DataRow dr = orderDT.NewRow(); dr["Balance_price"] = Money; dr["Freight"] = 0; dr["Ordersamount"] = Money; orderDT.Rows.Add(dr); } else if (!string.IsNullOrEmpty(PayNo)) { payMod = payBll.SelModelByPayNo(PayNo); OrderHelper.OrdersCheck(payMod); orderDT = orderBll.GetOrderbyOrderNo(payMod.PaymentNum); } else { M_OrderList orderMod = orderBll.SelModelByOrderNo(OrderNo); OrderHelper.OrdersCheck(orderMod); orderDT = orderBll.GetOrderbyOrderNo(OrderNo); } if (orderDT != null && orderDT.Rows.Count > 0) { //如果是跳转回来的,检测其是否包含充值订单 foreach (DataRow dr in orderDT.Rows) { if (DataConverter.CLng(dr["Ordertype"]) == (int)M_OrderList.OrderEnum.Purse) { virtual_ul.Visible = false; break; } } //总金额,如有支付单,以支付单的为准 GetTotal(orderDT, ref price, ref fare, ref allamount); if (!string.IsNullOrEmpty(PayNo)) { allamount = (double)payMod.MoneyPay; arrive = payMod.ArriveMoney; } TxtvMoney.Text = price.ToString("f2");// + " + " + fare.ToString("f2") + " - " + arrive.ToString("f2") + " = " + allamount.ToString("f2") TxtvMoney.Text = TxtvMoney.Text + ""; OrderCode.Text = OrderNo; } //支付币种 //BindMoney(); //支付平台 BindPlat(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.HttpMethod == "GET") { Auth(); return; } try { buser = new B_User(HttpContext.Current); requesdata = GetXml(); //requesdata = "<xml><ToUserName><![CDATA[gh_33273dafc0e4]]></ToUserName> <FromUserName><![CDATA[olwfpsvje_OHogJ8rOANahcqSijk]]></FromUserName> <CreateTime>1434081760</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[pic]]></Content> <MsgId>6159334259197323209</MsgId> </xml>"; if (string.IsNullOrEmpty(requesdata)) { return; } M_WxTextMsg reqMod = new M_WxTextMsg(requesdata); //获取需要返回的公众号 M_WX_APPID appmod = appBll.GetAppByWxNo(reqMod.ToUserName); if (appmod == null) { throw new Exception("目标公众号[" + reqMod.ToUserName + "]不存在"); } api = WxAPI.Code_Get(appmod); errmsg += "动作:" + reqMod.MsgType; switch (reqMod.MsgType) { case "event": //事件--关注处理,后期扩展单击等 { //M_WxImgMsg msgMod = JsonConvert.DeserializeObject<M_WxImgMsg>(appmod.WelStr); M_WxImgMsg msgMod = new M_WxImgMsg(); msgMod.ToUserName = reqMod.FromUserName; msgMod.FromUserName = reqMod.ToUserName; WxEventHandler(reqMod); //系统事件处理 //登录检测,可按需取消或修改位置 M_UserInfo mu = UserBindCheck(reqMod); //if (mu.IsNull) //{ // msgMod.Articles.Add(new M_WXImgItem() // { // Title = "请先关联用户", // Description = "你尚未关联用户,点击登录关联用户", // Url = baseUrl + "/User/Login.aspx?WXOpenID=" + reqMod.FromUserName // }); // RepToClient(msgMod.ToXML()); //} WxMenuBtnHandler(reqMod, msgMod, mu); } break; case "text": //接收文本消息 { string xml = UserTextDeal(reqMod); RepToClient(xml); } break; } } catch (Exception ex) { ZLLog.L("微信报错," + errmsg + ",数据:" + requesdata + ",原因:" + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(Request.RawUrl); if (!IsPostBack) { M_UserInfo mu = buser.GetLogin(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { B_User.CheckIsLogged(); function.Script(this, "GetCurrent();"); } }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(Request.RawUrl); id = Request.QueryString["id"]; DataTable dom = domListBll.SelByID(id); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "setValue('" + dom.Rows[0]["RegInfo"] + "');", true); }
//结算,到订单页再生成AllMoney protected void NextStep_Click(object sender, EventArgs e) { //AJAX就先检测一遍,未登录则弹窗 B_User.CheckIsLogged(Request.RawUrl); string ids = Request.Form["prochk"]; Response.Redirect("GetOrderInfo1.aspx?ids=" + ids + "&ProClass=" + ProClass + "&remark=" + Request["remark"] + "&appid=" + Request["appid"]);//"#none" }
//-----------修改密码 public ActionResult Pwd() { if (!B_User.CheckIsLogged(Request.RawUrl)) { return(null); } return(View()); }
public string GetGroupName() { B_User buser = new B_User(); string GroupID = buser.GetLogin().GroupID.ToString(); B_Group bgp = new B_Group(); return(bgp.GetByID(DataConverter.CLng(GroupID)).GroupName); }
public FrmChangePass(AdminMsg LoginMsg) { InitializeComponent(); LoginInMsg = LoginMsg; bu = new B_User(LoginInMsg.SqlConn); BOperation = new BOperationRecord(LoginInMsg.SqlConn); log = new Log(PublicValues.LogFilePath); }
public ActionResult Submission() { if (!B_User.CheckIsLogged()) { return(null); } return(View()); }
public static M_CommonData Store2_User() { M_UserInfo mu = new B_User().GetLogin(); B_Content conBll = new B_Content(); M_CommonData storeMod = conBll.SelReturnModel(mu.SiteID); return(storeMod); }
protected void Page_Load(object sender, EventArgs e) { ZoomLa.Common.function.AccessRulo(); B_Admin badmin = new B_Admin(); B_User ubll = new B_User(); int id = int.Parse(base.Request.QueryString["id"]); Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + customPath2 + "User/UserManage.aspx'>会员管理</a></li><li><a href='ZoneManage.aspx'>会员空间管理</a></li><li class='active'>查看申请信息</li>"); }
public ActionResult APPList() { B_User.CheckIsLogged(Request.RawUrl); M_UserInfo mu = buser.GetLogin(); DataTable dt = appBll.SelBySite(mu.UserID.ToString()); return(View(dt)); }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(); if (!IsPostBack) { MyBind(); } }
/// <summary> /// 本班同学 /// </summary> /// <returns></returns> public ActionResult MyClassmates() { dto_User u = B_UserRedis.GetUser(UserId); List <T_User> list = B_User.GetClassmates(u.SchoolId, u.GradeId, u.ClassId); ViewBag.List = list; return(PartialView()); }