protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } // 未登录,作为报名页面 if (Session["phone"] == null || Session["iden"] == null) { signBtn1.InnerText = "立即报名"; signBtn2.InnerText = "立即报名"; } // 普通会员、管理员可查看 if (Session["iden"] != null && Session["iden"].ToString() != "1" && Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } // 没有参数 if (!Request.QueryString.AllKeys.Contains("aid")) { Response.Redirect("/Activity.aspx"); return; } // 活动ID string aid = Request.QueryString["aid"].ToString(); // 获取活动 var activity = DataBase.Activity.Get(new Objects.Activity() { id = aid }); activity_name.InnerText = activity_name.InnerText.Replace("#title#", activity.title); end_time.InnerText = end_time.InnerText.Replace("#end-time#", activity.timeEnd.ToString("yyyy-MM-dd HH:mm:ss")); js_content.InnerHtml = js_content.InnerHtml.Replace("#content#", activity.content); Title = activity.brief; /* * appId: appId * timestamp: timestamp * nonceStr: nonceStr * signature: signature */ var timestamp = OSecurity.DateTimeToTimeStamp(DateTime.Now); String script = "var appId = '" + WXManage.appID + "';"; script += "var timestamp = '" + timestamp.ToString() + "';"; script += "var nonceStr = 'chenyanhong';"; script += "var signature = '" + WXManage.WXJSSign("chenyanhong", timestamp, Request.Url.ToString().Split('#')[0]) + "';"; script += "var imgUrl = '" + WXManage.QRCode(Request.Url.ToString() + "&uid=" + Session["phone"]) + "';"; if (Session["phone"] != null) { script += "var uid = '" + Session["phone"].ToString() + "';"; } ScriptManager.RegisterClientScriptBlock(this, GetType(), "wxvar", script, true); }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } string html = "<div class=\"weui-cell weui-cell_access\" onclick=\"location.href='/StaffYWYDetail.aspx?uid=#id#';\">" + " <div class=\"weui-cell__bd\">#name#</div>"+ " <div class=\"weui-cell__ft\" style=\"font-size: 0\">"+ " <span style=\"vertical-align: middle; font-size: 17px;\">#phone#</span>"+ " </div>"+ "</div>"; var array = DataBase.User.Gets("2"); list.InnerHtml = ""; foreach (var item in array) { list.InnerHtml += html .Replace("#id#", item.id) .Replace("#name#", item.name) .Replace("#phone#", item.phone); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["tid"] == null) { Response.Redirect("/StaffManageSGDW.aspx"); return; } string listHTML = "<a class=\"weui-cell weui-cell_access\" href=\"/StaffSGRYDetail.aspx?uid=#id#\">" + " <div class=\"weui-cell__bd\">"+ " <p>#name#</p>"+ " </div>"+ " <div class=\"weui-cell__ft\">"+ " </div>"+ "</a>"; if (Request.QueryString["tid"] == null) { Response.Clear(); Response.Redirect("/StaffManageSGDW.aspx"); return; } var tid = Request.QueryString["tid"]; var team = DataBase.Team.GetWithMembers(new Objects.Team() { id = tid }); name.Value = team.teamName; foreach (var user in team.members) { members.InnerHtml += listHTML.Replace("#name#", user.name).Replace("#id#", user.id); } if (team.members.Count == 0) { members.InnerHtml = "<p style=\"text-align:center;\"><a href=\"/StaffManageSGRY.aspx\">该队伍没有成员,点击前往添加</a></p>"; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["uid"] == null) { Response.Redirect("/StaffManageSGRY.aspx"); return; } var uid = Request.QueryString["uid"]; var user = DataBase.User.GetByID(new Objects.User() { id = uid }); name.Value = user.name; tel.Value = user.phone; idCard.Value = user.IDCard; var teams = DataBase.Team.Gets(); teamSelect.Items.Clear(); teamSelect.Items.Add(new ListItem("请选择施工队", "0")); foreach (var team in teams) { teamSelect.Items.Add(new ListItem(team.teamName, team.id)); } var signedTeam = DataBase.Team.Get(user); if (signedTeam == null) { team.Value = "未加入"; } else { team.Value = signedTeam.teamName; addToTeam.InnerText = "修改所在施工队"; teamSelect.Items.Insert(1, new ListItem("从施工队中移除", "-1")); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (IsPostBack) { // 手机 var phone = Request.Form["tel"]; // 短信验证码 var code = Request.Form["code"]; // 身份 var iden = Int32.Parse(Request.Form["iden"]); // 格式检查 if (!OSecurity.ValidPhone(phone) || // 手机号 !Regex.IsMatch(code, "^\\d{4}$") || // 验证码4位数字 iden < 1 || iden > 5 // 身份在[1,5] ) { return; } // 验证码检查 if (!AuthCode.CheckAuthCode(phone, code)) { ScriptManager.RegisterStartupScript(this, GetType(), "codeError", "alterError($('input[name=code]')[0]);", true); return; } // 普通会员-业务员-施工队-管理员 if (iden == 1 || iden == 2 || iden == 4 || iden == 5) { if (DataBase.User.Exits(new Objects.User() { phone = phone, identity = iden.ToString() })) { Session["phone"] = phone; Session["iden"] = iden; Response.Redirect("/UserIndex.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["rid"] == "") { Response.Clear(); Response.Redirect("/RegisterAuth.aspx"); return; } var rid = Request.QueryString["rid"]; var rauth = DataBase.UserUnAuth.Get(new Objects.User() { id = rid }); inputName.Value = rauth.name; inputPhone.Value = rauth.phone; var identity = ""; switch (rauth.identity) { case "2": identity = "业务员"; break; case "4": identity = "施工队"; break; case "5": identity = "管理员"; break; } inputIden.Value = identity; inputIDCard.Value = rauth.IDCard; }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null) { Response.Redirect("/UserIndex.aspx"); return; } if (IsPostBack) { var pass1 = Request.Form["password1"]; var pass2 = Request.Form["password2"]; if (pass1 == "" || pass2 == "") { ScriptManager.RegisterClientScriptBlock(this, GetType(), "empty", "alert('密码不能为空!')", true); return; } if (pass1 != pass2) { ScriptManager.RegisterClientScriptBlock(this, GetType(), "equal", "alert('两次输入密码不一致!')", true); return; } var user = DataBase.User.Get(new Objects.User() { phone = Session["phone"].ToString(), identity = Session["iden"].ToString() }); user.password = pass1; if (DataBase.User.ModifyPassword(user)) { Response.Redirect("/UserIndex.aspx"); return; } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "error", "alert('系统错误')", true); return; } } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["uid"] == null) { Response.Redirect("/StaffManageYWY.aspx"); return; } if (Request.QueryString["del"] == "true") { if (DataBase.User.Delete(new Objects.User() { id = Request.QueryString["uid"] } )) { Response.Redirect("/StaffManageYWY.aspx"); return; } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "error", "alert('删除失败,服务器错误')", true); } } var uid = Request.QueryString["uid"]; var user = DataBase.User.GetByID(new Objects.User() { id = uid }); name.Value = user.name; tel.Value = user.phone; idCard.Value = user.IDCard; }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } // 只有管理员能查看所有活动 if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } string activityHTML = "<a href=\"/ActivityEditor.aspx?aid=#id#\" class=\"weui-media-box weui-media-box_appmsg\">" + " <div class=\"weui-media-box__hd\">" + " <img class=\"weui-media-box__thumb\" src=\"#img#\" alt=\"\">" + " </div>" + " <div class=\"weui-media-box__bd\">" + " <h4 class=\"weui-media-box__title\">#title#</h4>" + " <p class=\"weui-media-box__desc\">#brief#</p>" + " </div>" + "</a>"; // 获取所有活动 var activityList = DataBase.Activity.GetsAll(); activities.InnerHtml = ""; foreach (var activity in activityList) { if (activity.imgSrc == null || activity.imgSrc == "") { activity.imgSrc = WXManage.QRCode(Request.Url.Host + "/ActivityDetail.aspx?aid=" + activity.id); } activities.InnerHtml += activityHTML .Replace("#id#", activity.id) .Replace("#img#", activity.imgSrc) .Replace("#title#", activity.title) .Replace("#brief#", activity.brief); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } string html = "<div class=\"weui-cell weui-cell_access\" onclick=\"location.href='/StaffSGRYDetail.aspx?uid=#id#';\">" + " <div class=\"weui-cell__bd\">#name#</div>"+ " <div class=\"weui-cell__ft\" style=\"font-size: 0\">"+ " <span style=\"vertical-align: middle; font-size: 17px;\">#phone#</span>#noteam#"+ " </div>"+ "</div>"; string noTeam = "<span class=\"weui-badge weui-badge_dot\" style=\"margin-left: 5px; margin-right: 5px; \"></span>"; var noTeamList = DataBase.Team.UnRegisterToTeam(); Dictionary <string, bool> unRegister = new Dictionary <string, bool>(); foreach (var item in noTeamList) { unRegister[item.phone] = true; } var array = DataBase.User.Gets("4"); list.InnerHtml = ""; foreach (var item in array) { list.InnerHtml += html .Replace("#id#", item.id) .Replace("#name#", item.name) .Replace("#phone#", item.phone) .Replace("#noteam#", unRegister.ContainsKey(item.phone) ? noTeam : ""); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } string html = "<div class=\"weui-cell weui-cell_access\" onclick=\"location.href='/StaffSGDWDetail.aspx?tid=#id#';\">" + " <div class=\"weui-cell__bd\">#name#</div>"+ " <div class=\"weui-cell__ft\" style=\"font-size: 0\">"+ " <span style=\"vertical-align: middle; font-size: 17px;\">#memberCount#人</span>"+ " </div>"+ "</div>"; var array = DataBase.Team.GetsWithMembers(); var allTeam = DataBase.Team.Gets(); foreach (var team in allTeam) { if (!array.ContainsKey(team.id)) { array[team.id] = team; } } list.InnerHtml = ""; foreach (var item in array) { list.InnerHtml += html .Replace("#id#", item.Key) .Replace("#name#", item.Value.teamName) .Replace("#memberCount#", item.Value.members.Count.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } var list = DataBase.Team.UnRegisterToTeam(); if (list.Count != 0) { newReg.Style["display"] = "block"; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } string activityHTML = "<a href=\"/ActivityDetail.aspx?aid=#id#\" class=\"weui-media-box weui-media-box_appmsg\">" + " <div class=\"weui-media-box__hd\">" + " <img class=\"weui-media-box__thumb\" src=\"#img#\" alt=\"\">" + " </div>" + " <div class=\"weui-media-box__bd\">" + " <h4 class=\"weui-media-box__title\">#title#</h4>" + " <p class=\"weui-media-box__desc\">#brief#</p>" + " </div>" + "</a>"; var activityList = DataBase.Activity.Gets(); activities.InnerHtml = ""; foreach (var activity in activityList) { if (activity.imgSrc == null || activity.imgSrc == "") { activity.imgSrc = WXManage.QRCode(Request.Url.Host + "/ActivityDetail.aspx?aid=" + activity.id); } activities.InnerHtml += activityHTML .Replace("#id#", activity.id) .Replace("#img#", activity.imgSrc) .Replace("#title#", activity.title) .Replace("#brief#", activity.brief); } if (activityList.Count == 0) { activities.InnerHtml = "<p style=\"text-align:center;\">当前没有活动</p>"; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null) { Response.Redirect("/UserIndex.aspx"); return; } var user = DataBase.User.Get(new Objects.User() { phone = Session["phone"].ToString(), identity = Session["iden"].ToString() }); inputName.Value = user.name; inputPhone.Value = user.phone; if (user.identity == "1") // 普通会员 { IDCardDiv.InnerHtml = ""; IDCardDiv.Style["display"] = "none"; } else { inputIDCard.Value = user.IDCard.Substring(0, 6) + new string('*', 8) + user.IDCard.Substring(14); } var openID = DataBase.User.GetOpenID(user); if (!string.IsNullOrEmpty(openID)) { inputOpenID.Value = openID; save.InnerText = "修改消息标识"; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } // 获取所有活动,显示标题 var activitys = DataBase.Activity.GetsAll(); activitySelect.Items.Clear(); activitySelect.Items.Add(new ListItem("所有活动", "0")); var firstActivityHasSign = "0"; foreach (var activity in activitys) { var count = DataBase.ActivitySign.Gets(activity).Count; if (count != 0 && firstActivityHasSign == "0") { firstActivityHasSign = activity.id; } // 报名数量不为0的显示数量 activitySelect.Items.Add(new ListItem(activity.title + (count == 0 ? "" : ("(" + count + ")")), activity.id)); } // 有新报名,则显示新报名信息 if (firstActivityHasSign != "0" && !IsPostBack) // 回发时不处理 { activitySelect.Value = firstActivityHasSign; ScriptManager.RegisterStartupScript(this, GetType(), "show", "$('#selectActivity').click();", true); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "4") { Response.Redirect("/UserIndex.aspx"); return; } var statusList = new DataBase.Status().Gets(); statusSelect.Items.Clear(); statusSelect.Items.Add(new ListItem("所有订单", "-1")); foreach (var status in statusList) { statusSelect.Items.Add(new ListItem(status.view, status.id)); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["aid"] == null) { Response.Redirect("/Activity.aspx"); return; } // 保存 if (IsPostBack) { var id = Request.QueryString["aid"]; DateTime timeStart = DateTime.Parse(Request.Form["timeStart"]); DateTime timeEnd = DateTime.Parse(Request.Form["timeEnd"]); var title = Request.Form["title"]; var content = Request.Unvalidated["htmlInput"]; int template = int.Parse(Request.Form["templateSelect"]); var brief = Request.Form["brief"]; bool valid = checkValid.Checked; var imgSrc = ""; var templateAddition = Request.Form["templateAdditionInput"]; if (title == "" || content == "" || brief == "" || templateAddition == "" || Request.Files.Count > 1) { return; } if (Request.Files.Count == 1) { var imgName = Request.Files[0].FileName; string path = "/WXShare/uploads/" + DateTime.Now.ToString("yyyyMMdd"); if (!Directory.Exists("/WXShare/uploads")) { Directory.CreateDirectory("/WXShare/uploads"); } if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } path += "/" + OSecurity.DateTimeToTimeStamp(DateTime.Now) + "." + imgName.Substring(imgName.LastIndexOf('.') + 1); Request.Files[0].SaveAs(path); imgSrc = path.Substring(8); } Objects.Activity modActivity = new Objects.Activity() { id = id, timeStart = timeStart, timeEnd = timeEnd, title = title, content = content, template = template, brief = brief, valid = valid, imgSrc = imgSrc, templateAddition = templateAddition }; if (!DataBase.Activity.Modify(modActivity)) { ScriptManager.RegisterClientScriptBlock(this, GetType(), "saveFailed", "alert('保存失败');", true); return; } Response.Redirect(Request.Url.ToString()); } // 显示 var activityID = Request.QueryString["aid"]; var activity = DataBase.Activity.Get(new Objects.Activity() { id = activityID }); timeStart.Value = activity.timeStart.ToString("yyyy-MM-ddTHH:mm:ss"); timeEnd.Value = activity.timeEnd.ToString("yyyy-MM-ddTHH:mm:ss"); title.Value = activity.title; textarea.InnerHtml = activity.content; var templates = DataBase.Template.Gets(); templateSelect.Items.Clear(); foreach (var template in templates) { templateSelect.Items.Add(new ListItem(template.name, template.id)); if (template.id == activity.id) { templateSelect.SelectedIndex = templateSelect.Items.Count - 1; } } templateAdditionInput.Value = activity.templateAddition; brief.Value = activity.brief; checkValid.Checked = activity.valid; if (activity.imgSrc != "") { ScriptManager.RegisterStartupScript(this, GetType(), "showImgSrc", "showImgSrc('//" + Request.Url.Host + "" + activity.imgSrc + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } // 没有登录 if (Session["phone"] == null) { Response.Redirect("/UserLogin.aspx"); return; } // 没有设置密码 var user = DataBase.User.Get(new Objects.User() { phone = Session["phone"].ToString(), identity = Session["iden"].ToString() }); if (user.password == "") { Response.Redirect("/UserSetPassword.aspx"); return; } if (Session["iden"].ToString() == "2") { // 新的派单订单 var list = DataBase.Order.Gets(user); int count = 0; foreach (var order in list) { if (order.status == 0) { count++; } } if (count != 0) { newOrderCountYWY.Style["display"] = ""; newOrderCountYWY.InnerText = count.ToString(); } } else if (Session["iden"].ToString() == "4") { // 新的派工订单 var team = DataBase.Team.Get(user); var list = DataBase.Order.Gets(team); int count = 0; foreach (var order in list) { if (order.status == 8) { count++; } } if (count != 0) { newOrderCountSGD.Style["display"] = ""; newOrderCountSGD.InnerText = count.ToString(); } } else if (Session["iden"].ToString() == "5") { // 新的活动报名 var asign = DataBase.ActivitySign.Gets(); if (asign.Count != 0) { newActivitySign.Style["display"] = ""; newActivitySign.InnerText = asign.Count.ToString(); } // 新的注册 var userAuth = DataBase.UserUnAuth.Gets(); if (userAuth.Count != 0) { newRegister.Style["display"] = ""; newRegister.InnerText = userAuth.Count.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "4") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["oid"] == null) { Response.Clear(); Response.Redirect("/OrdersForSGD.aspx"); return; } // 获取订单信息 var oid = Request.QueryString["oid"]; var order = DataBase.Order.GetByID(new Objects.Order() { id = oid }); inputName.Value = order.name; inputPhone.Value = order.phone; inputLocation.Value = order.location; inputLocationDetail.Value = order.locationDetail; inputStatus.Value = new DataBase.Status() .Get( new Objects.Status() { id = order.status.ToString() } ) .view; // 获取活动优惠 var activity = DataBase.Activity.Get(new Objects.Activity() { id = order.youHuiLaiYuan.ToString() }); if (activity.template == 1) { var addition = activity.templateAddition.Split(','); inputYouHui.Value = "满" + addition[0] + "减" + addition[1]; } else if (activity.template == 2) { var addition = activity.templateAddition.Split(','); inputYouHui.Value = "满" + addition[0] + "赠送" + addition[1]; } // 涂刷类型、涂刷需求 inputBrushType.Value = new DataBase.BrushType().Get(new Objects.BrushType() { id = order.brushType.ToString() }).view; inputBrushDemand.Value = ""; foreach (var dem in order.brushDemand.Split(',')) { inputBrushDemand.Value += new DataBase.BrushDemand().Get(new Objects.BrushDemand() { id = dem }).view + ","; } inputBrushDemand.Value = inputBrushDemand.Value.Substring(0, inputBrushDemand.Value.Length - 1); // 房屋用途、房屋类型、房屋结构、面积等 inputHousePurpose.Value = new DataBase.HousePurpose().Get(new Objects.HousePurpose() { id = order.housePurpose.ToString() }).view; inputHouseType.Value = new DataBase.HouseType().Get(new Objects.HouseType() { id = order.houseType.ToString() }).view; inputHouseStructure.Value = new DataBase.HouseStructure().Get(new Objects.HouseStructure() { id = order.houseStructure.ToString() }).view; inputMianJiSubmitted.Value = order.mianJi.ToString(); inputNeiQiangSubmitted.Value = order.neiQiang.ToString(); inputYiShuQiSubmitted.Value = order.yiShuQi.ToString(); inputWaiQiangSubmitted.Value = order.waiQiang.ToString(); inputYangTaiSubmitted.Value = order.yangTai.ToString(); inputMuQiSubmitted.Value = order.muQi.ToString(); inputTieYiSubmitted.Value = order.tieYi.ToString(); // 计划施工时间,计划完工时间,计划工期 inputWorkOrderDateSubmitted.Value = order.workOrderDate.ToString("yyyy-MM-dd"); inputWorkCompleteOrderDateSubmitted.Value = order.workCompleteOrderDate.ToString("yyyy-MM-dd"); inputContractNumberSubmitted.Value = order.contractNumber; // 各种金额 var sum = order.smSum + order.mmSum + order.workSum; if (activity.template == 1) { if (sum >= int.Parse(activity.templateAddition.Split(',')[0])) { sum -= int.Parse(activity.templateAddition.Split(',')[1]); } } cashRec.Value = sum.ToString("0.0"); inputMMSumSubmitted.Value = order.mmSum.ToString("0.0"); inputSMSumSubmitted.Value = order.smSum.ToString("0.0"); inputWorkSumSubmitted.Value = order.workSum.ToString("0.0"); if (order.status >= 9) { inputWorkDate.Value = order.workDate.ToString("yyyy-MM-dd"); workDateDiv.Style["display"] = ""; } if (order.status > 9) { inputWorkCompleteDate.Value = order.workCompleteDate.ToString("yyyy-MM-dd"); workCompleteDateDiv.Style["display"] = ""; } // 调整按钮 if (order.status != 8) { statusBtn_8.InnerHtml = ""; statusBtn_8.Style["display"] = "none"; } if (order.status != 9) { statusBtn_9.InnerHtml = ""; statusBtn_9.Style["display"] = "none"; } // 停工继续按钮 if (DataBase.Order.HasPaused(order)) { inputStatus.Value = "临时停工"; // 隐藏完工按钮 statusBtn_9.InnerHtml = ""; statusBtn_9.Style["display"] = "none"; // 显示重新开工按钮 statusBtn_8_5.Style["display"] = ""; } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "2") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["oid"] == null) { Response.Clear(); Response.Redirect("/OrdersForYWY.aspx"); return; } // 获取订单信息 var oid = Request.QueryString["oid"]; var order = DataBase.Order.GetByID(new Objects.Order() { id = oid }); inputName.Value = order.name; inputPhone.Value = order.phone; inputLocation.Value = order.location; inputLocationDetail.Value = order.locationDetail; inputStatus.Value = new DataBase.Status() .Get( new Objects.Status() { id = order.status.ToString() } ) .view; // 获取活动优惠 var activity = DataBase.Activity.Get(new Objects.Activity() { id = order.youHuiLaiYuan.ToString() }); inputYouHui.Attributes["data-t"] = activity.template.ToString(); inputYouHui.Attributes["data-a"] = activity.templateAddition; if (activity.template == 1) { var addition = activity.templateAddition.Split(','); inputYouHui.Value = "满" + addition[0] + "减" + addition[1]; } else if (activity.template == 2) { var addition = activity.templateAddition.Split(','); inputYouHui.Value = "满" + addition[0] + "赠送" + addition[1]; } HideOthers(order.status); // 派单完成 if (order.status == 0) { // 获取涂刷类型 var brushType = new DataBase.BrushType().Gets(); typeSelect.Items.Clear(); typeSelect.Items.Add(new ListItem("选择涂刷类型", "0")); foreach (var type in brushType) { if (type.id == "0") { continue; } typeSelect.Items.Add(new ListItem(type.view, type.id)); } // 获取涂刷需求 string demandHtml = "<label class=\"weui-cell weui-check__label\" for=\"#id#\">" + " <div class=\"weui-cell__hd\">"+ " <input type=\"checkbox\" class=\"weui-check\" name=\"select_#id#\" id=\"#id#\">"+ " <i class=\"weui-icon-checked\"></i>"+ " </div>"+ " <div class=\"weui-cell__bd\">"+ " <p>#content#</p>"+ " </div>"+ "</label>"; var brushDemand = new DataBase.BrushDemand().Gets(); demandList.InnerHtml = ""; foreach (var demand in brushDemand) { if (demand.id == "0") { continue; } demandList.InnerHtml += demandHtml .Replace("#id#", demand.id) .Replace("#content#", demand.view); } } // 订单取消 else if (order.status == 1) { requiredHint.InnerHtml = ""; requiredHint.Style["display"] = "none"; } // 预约基检 else if (order.status == 2) { // 获取房屋用途 var housePurpose = new DataBase.HousePurpose().Gets(); housePurposeSelect.Items.Clear(); housePurposeSelect.Items.Add(new ListItem("选择房屋用途", "0")); foreach (var purpose in housePurpose) { if (purpose.id == "0") { continue; } housePurposeSelect.Items.Add(new ListItem(purpose.view, purpose.id)); } // 获取房屋类型 var houseType = new DataBase.HouseType().Gets(); houseTypeSelect.Items.Clear(); houseTypeSelect.Items.Add(new ListItem("选择房屋类型", "0")); foreach (var type in houseType) { if (type.id == "0") { continue; } houseTypeSelect.Items.Add(new ListItem(type.view, type.id)); } // 获取房屋结构 var houseStructure = new DataBase.HouseStructure().Gets(); houseStructureSelect.Items.Clear(); houseStructureSelect.Items.Add(new ListItem("选择房屋结构", "0")); foreach (var structure in houseStructure) { if (structure.id == "0") { continue; } houseStructureSelect.Items.Add(new ListItem(structure.view, structure.id)); } // 判断基检是否已经开始 if (order.comCheckTime == DateTime.Parse("2017-01-01 00:00:00")) { // 未开始 start.Style["display"] = ""; status_2.InnerHtml = ""; inputStatus.Value += " - " + order.comCheckOrderTime.ToString("yyyy-MM-dd HH:mm:ss"); } else { // 正在基检 finish.Style["display"] = ""; inputStatus.Value = "正在基检 - " + order.comCheckTime.ToString("yyyy-MM-dd HH:mm:ss"); } } // 基检完成 else if (order.status == 3) { // } // 签约成功 else if (order.status == 5) { // } // 签约失败、其他 else { requiredHint.InnerHtml = ""; requiredHint.Style["display"] = "none"; } if (order.status > 0) { // 显示预约的内容 inputBrushType.Value = new DataBase.BrushType().Get(new Objects.BrushType() { id = order.brushType.ToString() }).view; inputBrushDemand.Value = ""; foreach (var dem in order.brushDemand.Split(',')) { inputBrushDemand.Value += new DataBase.BrushDemand().Get(new Objects.BrushDemand() { id = dem }).view + ","; } inputBrushDemand.Value = inputBrushDemand.Value.Substring(0, inputBrushDemand.Value.Length - 1); } if (order.status > 2) { // 显示基检内容 inputHousePurpose.Value = new DataBase.HousePurpose().Get(new Objects.HousePurpose() { id = order.housePurpose.ToString() }).view; inputHouseType.Value = new DataBase.HouseType().Get(new Objects.HouseType() { id = order.houseType.ToString() }).view; inputHouseStructure.Value = new DataBase.HouseStructure().Get(new Objects.HouseStructure() { id = order.houseStructure.ToString() }).view; inputMianJiSubmitted.Value = order.mianJi.ToString(); inputNeiQiangSubmitted.Value = order.neiQiang.ToString(); inputYiShuQiSubmitted.Value = order.yiShuQi.ToString(); inputWaiQiangSubmitted.Value = order.waiQiang.ToString(); inputYangTaiSubmitted.Value = order.yangTai.ToString(); inputMuQiSubmitted.Value = order.muQi.ToString(); inputTieYiSubmitted.Value = order.tieYi.ToString(); } if (order.status > 3) { inputWorkOrderDateSubmitted.Value = order.workOrderDate.ToString("yyyy-MM-dd"); inputWorkCompleteOrderDateSubmitted.Value = order.workCompleteOrderDate.ToString("yyyy-MM-dd"); inputContractNumberSubmitted.Value = order.contractNumber; } // 收款完成+ 不含合同退单 if (order.status > 5 && order.status != 7) { var sum = order.smSum + order.mmSum + order.workSum; if (activity.template == 1) { if (sum >= int.Parse(activity.templateAddition.Split(',')[0])) { sum -= int.Parse(activity.templateAddition.Split(',')[1]); } } cashRec.Value = sum.ToString("0.0"); } inputMMSumSubmitted.Value = order.mmSum.ToString("0.0"); inputSMSumSubmitted.Value = order.smSum.ToString("0.0"); inputWorkSumSubmitted.Value = order.workSum.ToString("0.0"); }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] == null || Session["iden"].ToString() != "5") { Response.Redirect("/UserIndex.aspx"); return; } if (Request.QueryString["oid"] == null) { Response.Redirect("/OrderManage.aspx"); return; } // 获取订单信息 var oid = Request.QueryString["oid"]; var order = DataBase.Order.GetByID(new Objects.Order() { id = oid }); inputName.Value = order.name; inputPhone.Value = order.phone; inputLocation.Value = order.location; inputLocationDetail.Value = order.locationDetail; inputStatus.Value = new DataBase.Status() .Get( new Objects.Status() { id = order.status.ToString() } ) .view; // 获取活动优惠 var activity = DataBase.Activity.Get(new Objects.Activity() { id = order.youHuiLaiYuan.ToString() }); if (activity.template == 1) { var addition = activity.templateAddition.Split(','); inputYouHui.Value = "满" + addition[0] + "减" + addition[1]; } else if (activity.template == 2) { var addition = activity.templateAddition.Split(','); inputYouHui.Value = "满" + addition[0] + "赠送" + addition[1]; } // 显示业务员 var ywy = DataBase.User.Get(new Objects.User() { phone = order.commissioner, identity = "2" }); inputYWY.Value = ywy.name + " " + ywy.phone; if (order.status > 1) // 预约基检+ { // 显示预约的内容 inputBrushType.Value = new DataBase.BrushType().Get(new Objects.BrushType() { id = order.brushType.ToString() }).view; inputBrushDemand.Value = ""; foreach (var dem in order.brushDemand.Split(',')) { inputBrushDemand.Value += new DataBase.BrushDemand().Get(new Objects.BrushDemand() { id = dem }).view + ","; } inputBrushDemand.Value = inputBrushDemand.Value.Substring(0, inputBrushDemand.Value.Length - 1); } if (order.status > 2) // 基检完成+ { // 显示基检内容 inputHousePurpose.Value = new DataBase.HousePurpose().Get(new Objects.HousePurpose() { id = order.housePurpose.ToString() }).view; inputHouseType.Value = new DataBase.HouseType().Get(new Objects.HouseType() { id = order.houseType.ToString() }).view; inputHouseStructure.Value = new DataBase.HouseStructure().Get(new Objects.HouseStructure() { id = order.houseStructure.ToString() }).view; inputMianJiSubmitted.Value = order.mianJi.ToString(); inputNeiQiangSubmitted.Value = order.neiQiang.ToString(); inputYiShuQiSubmitted.Value = order.yiShuQi.ToString(); inputWaiQiangSubmitted.Value = order.waiQiang.ToString(); inputYangTaiSubmitted.Value = order.yangTai.ToString(); inputMuQiSubmitted.Value = order.muQi.ToString(); inputTieYiSubmitted.Value = order.tieYi.ToString(); } if (order.status > 3 && order.status != 5) // 签约成功+(签约失败没有计划) { // 显示计划施工 inputWorkOrderDateSubmitted.Value = order.workOrderDate.ToString("yyyy-MM-dd"); inputWorkCompleteOrderDateSubmitted.Value = order.workCompleteOrderDate.ToString("yyyy-MM-dd"); inputContractNumberSubmitted.Value = order.contractNumber; } if (order.status > 5) // 收款完成+ { // 各种金额 var sum = order.smSum + order.mmSum + order.workSum; if (activity.template == 1) { if (sum >= int.Parse(activity.templateAddition.Split(',')[0])) { sum -= int.Parse(activity.templateAddition.Split(',')[1]); } } cashRec.Value = sum.ToString("0.0"); inputMMSumSubmitted.Value = order.mmSum.ToString("0.0"); inputSMSumSubmitted.Value = order.smSum.ToString("0.0"); inputWorkSumSubmitted.Value = order.workSum.ToString("0.0"); } if (order.status > 7) // 派工完成+ { // 显示施工队 var team = DataBase.Team.Get(new Objects.Team() { id = order.constructionTeam }); inputSGD.Value = team.teamName; } // 订单取消原因、签约不成功原因、退单原因 if (order.status == 1) { reasonDiv.Style["display"] = ""; inputReason.Value = order.canceledReason; } else if (order.status == 5) { reasonDiv.Style["display"] = ""; inputReason.Value = order.signFailedReason; } else if (order.status == 7) { reasonDiv.Style["display"] = ""; inputReason.Value = order.refuseReason; } // 调整按钮 if (order.status != 6) // 收款完成 { statusBtn_8.InnerHtml = ""; statusBtn_8.Style["display"] = "none"; } // 获取施工队 var teams = DataBase.Team.Gets(); SGDSelect.Items.Clear(); SGDSelect.Items.Add(new ListItem("请选择施工队", "0")); foreach (var team in teams) { SGDSelect.Items.Add(new ListItem(team.teamName, team.id)); } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Session["phone"] != null && Session["iden"] != null) { Response.Redirect("/UserIndex.aspx"); return; } if (IsPostBack) { String phone = Request.Form["tel"]; String password = Request.Form["password"]; int iden = Int32.Parse(Request.Form["iden"]); bool reme = Request.Form["autoLogin"] == "on"; // 格式检查 if (!OSecurity.ValidPhone(phone) || // 手机号 iden < 1 || iden > 5 // 身份在[1,5] ) { return; } // 普通会员-业务员-施工队-管理员 if (iden == 1 || iden == 2 || iden == 4 || iden == 5) { if (DataBase.User.Login(new Objects.User() { phone = phone, password = password, identity = iden.ToString() })) { Session["phone"] = phone; Session["iden"] = iden; if (reme) { var telc = new HttpCookie("tel", phone); telc.Expires = DateTime.Now.AddDays(15); var pasc = new HttpCookie("__p", OSecurity.AESEncrypt(password)); pasc.Expires = DateTime.Now.AddDays(15); var idenc = new HttpCookie("ide", iden.ToString()); idenc.Expires = DateTime.Now.AddDays(15); Response.SetCookie(telc); Response.SetCookie(pasc); Response.SetCookie(idenc); } Response.Redirect("/UserIndex.aspx"); } } } else { /* 自动登录 */ if (Request.Cookies["tel"] != null && Request.Cookies["__p"] != null && Request.Cookies["ide"] != null) { var phone = Request.Cookies["tel"].Value; var password = Request.Cookies["__p"].Value; var iden = Request.Cookies["ide"].Value; if (DataBase.User.Login(new Objects.User() { phone = phone, password = OSecurity.AESDecrypt(password), identity = iden.ToString() })) { Session["phone"] = phone; Session["iden"] = iden; Response.Redirect("/UserIndex.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (Request.QueryString["aid"] == null) { Response.Redirect("/Activity.aspx"); return; } if (IsPostBack) { string phone = Request.Form["tel"]; // 手机 string name = Request.Form["name"]; // 姓名 string code = Request.Form["code"]; // 验证码 string location = Request.Form["location"]; // 地址 string locationDetail = Request.Form["detailLocation"]; // 详细地址 // 格式检查 if (name == "" || // 姓名不空 !OSecurity.ValidPhone(phone) || // 手机号 !Regex.IsMatch(code, "^\\d{4}$") || // 验证码4位数字 location == "" // 详细地址为空 ) { return; } // 验证码检查 if (!AuthCode.CheckAuthCode(phone, code)) { ScriptManager.RegisterStartupScript(this, GetType(), "codeError", "alterError($('input[name=code]')[0]);", true); return; } string activityID = Request.QueryString["aid"]; string userID = Request.QueryString["uid"]; // 即手机号 if (activityID == "" || userID == "") { return; } var activity = DataBase.Activity.Get(new Objects.Activity() { id = activityID }); if (activity == null) { ScriptManager.RegisterClientScriptBlock(this, GetType(), "noaid", "alert('不存在此活动!');", true); return; } if (activity.timeEnd <= DateTime.Now) { ScriptManager.RegisterClientScriptBlock(this, GetType(), "ended", "alert('活动已结束!');", true); return; } var user = DataBase.User.Get(new Objects.User() { phone = userID, identity = "1" }); if (user == null) { ScriptManager.RegisterClientScriptBlock(this, GetType(), "nouid", "alert('不存在该推荐人!');", true); return; } if (DataBase.ActivitySign.Add(new Objects.ActivitySign() { name = name, phone = phone, location = location, locationDetail = locationDetail, activityID = activityID, shareSource = userID })) { // 发送新报名提示 var admins = DataBase.User.Gets("5"); foreach (var admin in admins) { var openid = DataBase.User.GetOpenID(admin); if (!string.IsNullOrEmpty(openid)) { WXManage.SendMessage(openid, "有一条新报名信息!"); } } Response.Redirect("/ActivitySignSuccess.aspx"); return; } } }
protected void Page_Load(object sender, EventArgs e) { // 不是微信内置浏览器 if (!WXManage.IsWXBrowser(Request)) { Response.Redirect("/RequireWX.aspx?url=" + Request.Url); return; } if (IsPostBack) { // 姓名 var name = Request.Form["name"]; // 手机 var phone = Request.Form["tel"]; // 短信验证码 var code = Request.Form["code"]; // 身份 var iden = Request.Form["iden"]; // 格式检查 if (name == "" || // 姓名不空 !OSecurity.ValidPhone(phone) || // 手机号 !Regex.IsMatch(code, "^\\d{4}$") || // 验证码4位数字 Int32.Parse(iden) < 1 || Int32.Parse(iden) > 5 // 身份在[1,5] ) { return; } // 验证码检查 if (!AuthCode.CheckAuthCode(phone, code)) { ScriptManager.RegisterStartupScript(this, GetType(), "codeError", "alterError($('input[name=code]')[0]);", true); return; } // 身份证(业务员-施工队-管理员) String IDCardYWY = null; // 身份证(经销商) String IDCardJXS; // 区县(经销商) String location; // 详细地址 String detailLocation; if (iden == "2" || iden == "4" || iden == "5") { IDCardYWY = Request.Form["idcard_ywy"]; // 身份证检查 if (!OSecurity.ValidIDCard(IDCardYWY)) { return; } } if ((iden == "1" || iden == "2" || iden == "4" || iden == "5") && DataBase.User.Add(new Objects.User() { phone = phone, name = name, identity = iden, IDCard = IDCardYWY })) { ScriptManager.RegisterStartupScript(this, GetType(), "success", "success(" + iden + ", '注册成功', true);", true); } // 经销商 else if (iden == "3") { IDCardJXS = Request.Form["idcard_jxs"]; location = Request.Form["location"]; detailLocation = Request.Form["detailLocation"]; // 不实现 } else { return; } } }