protected void btnAddMember_Click(object sender, EventArgs e) { #region 封装参数 Member member = new Member() { MemberId = txtMemberId.Text.Trim(), Name = txtUserName.Text.Trim(), Pwd = txtPwd.Text.Trim(), FreezeDeadtime = Convert.ToDateTime(txtFreezeDeadtime.Text.Trim()), MemberState = txtMemberState.Text.Trim(), Picture = txtPicture.Text.Trim(), UserInfoId = txtUserinfoId.Text.Trim(), Xp = Convert.ToInt32(txtXp.Text.Trim()), IsOnline = false, LasttimeOnline = DateTime.Parse("2017-12-8") }; #endregion if (member.IsError == true) { //参数格式错误 Response.Write("参数格式错误,添加失败"); } else { string msg = MemberManagement.AddMember(member); Response.Write(msg); } }
void Bind() { string memberId = Convert.ToString(Request["memberId"]); DataTable dt; if (memberId != null) { dt = MemberManagement.SelectSixTable(memberId); if (dt.Rows.Count == 0) { SomeMethod.PrintMsgToClient(this.ClientScript, "未查找到相关会员的信息"); return; } string pic = SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]); //获取图片路径 divPic.Attributes.Add("style", "background-image:url(" + pic + ");"); //添加背景图片 hlkSendMsg.NavigateUrl = "~/MyMessage.aspx?recipient=" + Convert.ToString(dt.Rows[0]["member_id"]); lblConcernNum.Text = Convert.ToString(dt.Rows[0]["concern_num"]); lblFans.Text = Convert.ToString(dt.Rows[0]["fans"]); lblMotto.Text = Convert.ToString(dt.Rows[0]["motto"]); lblName.Text = Convert.ToString(dt.Rows[0]["name"]); lblPubCriticism.Text = "发表评论:" + Convert.ToString(dt.Rows[0]["criticism_num"]) + " "; lblPubTheme.Text = "发表主题:" + Convert.ToString(dt.Rows[0]["theme_num"]); } }
void Bind() { if (Request.QueryString["memberId"] != null) { #region 显示会员信息 //查找会员信息 Member member = MemberManagement.ShowMember(Request.QueryString["memberId"]); //显示会员信息 txtPicture.Text = member.Picture; txtMemberId.Text = member.MemberId; txtUserName.Text = member.Name; txtPwd.Text = member.Pwd; txtXp.Text = Convert.ToString(member.Xp); txtMemberState.Text = member.MemberState; txtFreezeDeadtime.Text = Convert.ToString(member.FreezeDeadtime); //查找用户个人信息 DataTable dt = UserInfoManagement.SelectById(member.UserInfoId); txtUserinfoId.Text = Convert.ToString(dt.Rows[0][0]); txtName.Text = Convert.ToString(dt.Rows[0][1]); txtSex.Text = Convert.ToString(dt.Rows[0][2]); txtAge.Text = Convert.ToString(dt.Rows[0][3]); txtTel.Text = Convert.ToString(dt.Rows[0][4]); txtEmail.Text = Convert.ToString(dt.Rows[0][5]); txtJob.Text = Convert.ToString(dt.Rows[0][6]); txtAddr.Text = Convert.ToString(dt.Rows[0][7]); txtMotto.Text = Convert.ToString(dt.Rows[0][8]); #endregion } }
protected void subEdit_ServerClick(object sender, ImageClickEventArgs e) { //【1】修改个人信息 UserInfo userInfo = new UserInfo() { Addr = adress.Value.Trim(), Age = Convert.ToInt32(age.Value.Trim()), Email = email.Value.Trim(), Job = job.Value.Trim(), Motto = motto.Value.Trim(), Name = realname.Value.Trim(), Tel = phone.Value.Trim(), Sex = radlSex.SelectedValue, UserInfoId = MemberManagement.ShowMember(Convert.ToString(Session["memberId"])).UserInfoId }; SomeMethod.PrintMsgToClient(this.ClientScript, UserInfoManagement.UpdateUserInfo(userInfo)); //【2】修改用户名 string Msg = MemberManagement.UpdateName(Convert.ToString(Session["memberId"]), username.Value.Trim()); if (Msg == "修改用户名成功") { Session["UserName"] = username.Value.Trim(); } SomeMethod.PrintMsgToClient(this.ClientScript, Msg); Bind(); }
protected void BtnRegister_Click(object sender, EventArgs e) { string Msg; userInfoId = UserInfoManagement.CreateUserInfoId(); UserInfo userInfo = GetUserInfo(); if (userInfo.IsError) { Msg = "参数格式错误"; SomeMethod.PrintMsgToClient(this.ClientScript, Msg); return; } UserInfoManagement.AddUserInfo(userInfo); //获取数据 Member member = GetMember(); //检验数据是否出错 if (member.IsError) { Msg = "参数格式错误"; SomeMethod.PrintMsgToClient(this.ClientScript, Msg); return; } //执行并返回执行结果 MemberManagement.AddMember(member); SomeMethod.PrintMsgToClient(this.ClientScript, "注册成功"); }
void Bind() { DataTable dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"])); if (dt.Rows.Count != 0) { pic.Attributes.Add("style", "background-image:url(../" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");"); } }
void search(string key) { dt = MemberManagement.SelectMember(key); if (dt == null) { printMsgToClient("搜索的值不允许为空"); return; } lvMember.DataSource = dt; lvMember.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { //【1】绑定头像 if (Session["memberId"] != null) { DataTable dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"])); if (dt.Rows.Count == 1) { imgHeadPic.ImageUrl = SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]); } } }
private void Init(atriumManager atMng) { base.DAL = atMng.DALMngr; myatMng = atMng; MyDS = new MemberManagement(); MyDS.EnforceConstraints = false; FixTZDSIssue(MyDS); myFM = myatMng.GetFile(); }
private static void ReduceMemberAccessAndIndexing(List <ParsingUnit> units) { for (int i = 0; i < units.Count; i++) { if (units[i] is MemberAccessUnit memberAccessUnit) { if (i == 0) { throw new ScriptParsingException( source: units[i].FirstToken, message: $"Expression began with a {units[i].OperatorType} operator: {units[i].FirstToken}"); } //Remove units.RemoveAt(i); i--; //Swap the ParsingUnit for the calculated value units[i] = new ParsedValuedUnit( value: MemberManagement.HandleMemberExpression( value: units[i].AsValueGetter, args: memberAccessUnit.args, identifier: memberAccessUnit.identifier, source: memberAccessUnit.FirstToken), firstToken: units[i].FirstToken); } else if (units[i] is IndexAccessUnit indexAccessUnit) { if (i == 0) { throw new ScriptParsingException( source: units[i].FirstToken, message: $"Expression began with a {units[i].OperatorType} operator: {units[i].FirstToken}"); } //Remove units.RemoveAt(i); i--; //Swap the ParsingUnit for the calculated value units[i] = new ParsedValuedUnit( value: new IndexerOperation( valueArg: units[i].AsValueGetter, indexArg: indexAccessUnit.arg, source: units[i].FirstToken), firstToken: units[i].FirstToken); } } }
protected void btnEditMember_Click(object sender, EventArgs e) { Member member = GetMember(); if (member.IsError == true) { //参数格式错误 Response.Write("参数格式错误,添加失败"); } else { string msg = MemberManagement.Update(member); Response.Write(msg); } }
protected void btnSearch_Click(object sender, EventArgs e) { if (ddlMemberSearch.SelectedValue == "所有") { Bind(); } else if (ddlMemberSearch.SelectedValue == "账号") { lvMember.DataSource = MemberManagement.Select(txtKey.Text.Trim()); lvMember.DataBind(); } else if (ddlMemberSearch.SelectedValue == "用户名") { Bind(); } }
protected void lvMember_ItemCommand(object sender, ListViewCommandEventArgs e) { //获取点击按钮所在项的MemberId(会员编号) string MemberId = (lvMember.Items[(e.Item.DataItemIndex)].FindControl("lblMemberId") as Label).Text; if (e.CommandName == "Edit") { Response.Redirect("MemberManage.aspx?memberId=" + MemberId); } else if (e.CommandName == "Del") { string Msg = MemberManagement.Delete(MemberId); SomeMethod.PrintMsgToClient(this.ClientScript, Msg); Bind(); } }
protected void subUpload_ServerClick(object sender, EventArgs e) { if (pic_upload.HasFile) { if (CheckFileType(pic_upload.FileName)) { string filename = DateTime.Now.ToString("yyyyMMddHHmmss") + pic_upload.FileName; //用FileUpload.FileName属性得到上传文件名,也可以使用HttpPostedFile.FileName得到。 string filePath = "~/Image/UserPic/" + filename; //MapPath方法,检索虚拟路径(绝对的或相对的)或应用程序相关的路径映射到的物理路径。 //FileUpload.SavaAs()方法用于把上传文件保存到文件系统中,也可以使用HttpPostedFile.SaveAs()方法。 pic_upload.SaveAs(Server.MapPath(filePath)); MemberManagement.UpdatePicture(Convert.ToString(Session["memberId"]), filename); } } }
protected void btnDeleteMember_Click(object sender, EventArgs e) { Member member = new Member() { MemberId = txtMemberId.Text.Trim() }; if (member.IsError == true) { //参数格式错误 Response.Write("参数格式错误,添加失败"); } else { string Msg = MemberManagement.Delete(member.MemberId); Response.Write(Msg); } }
public ServiceResponseData QueryMemberInfo() { int queryCardtype = (int)requestData.GetData <OP_Enum.MemberQueryType>(0); string cardno = requestData.GetData <string>(1); if (queryCardtype == (int)OP_Enum.MemberQueryType.会员ID) { DataTable dtPatinfo = NewObject <IOPManageDao>().GetMemberInfoByOther(string.Empty, string.Empty, string.Empty, Convert.ToInt32(cardno)); responseData.AddData(dtPatinfo); return(responseData); } else { MemberManagement membermanager = NewObject <MemberManagement>(); DataTable dtPatInfo = membermanager.QueryMemberInfo(queryCardtype, cardno);//卡号 responseData.AddData(dtPatInfo); return(responseData); } }
void Bind() { DataTable dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"])); if (dt.Rows.Count > 0) { pic.Attributes.Add("style", "background-image:url(" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");"); } int col = 3;//定义一行中显示的版块数 StringBuilder sb = new StringBuilder(); #region 动态生成版块列表 dt = DivisionManagement.ShowAll(); sb.Append("<table>"); for (int i = 0; i < dt.Rows.Count; i++) { if (i % col == 0) { sb.Append("<tr>"); } //<td> // <a href="ThemeList.aspx?divisionName=游戏"> // <img src="Image/Login/bg.jpg" /> // </a> //</td> sb.Append("<td><a href=\"ThemeList.aspx?divisionName="); sb.Append(dt.Rows[i]["division_name"]); //板块 sb.Append("\"><img src=\""); sb.Append("Image/DivisionPic/" + dt.Rows[i]["division_picture"]); //图片 sb.Append("\" title=\""); sb.Append(dt.Rows[i]["division_name"]); sb.Append("\" /></a></td>"); if ((i + 1) % col == 0) { sb.Append("</tr>"); } } sb.Append("</table>"); #endregion List.InnerHtml = Convert.ToString(sb); }
void Bind() { DataTable dt = UserInfoManagement.SelectInfo(Convert.ToString(Session["memberId"])); if (dt.Rows.Count == 1) { adress.Value = Convert.ToString(dt.Rows[0]["Addr"]); age.Value = Convert.ToString(dt.Rows[0]["Age"]); email.Value = Convert.ToString(dt.Rows[0]["Email"]); job.Value = Convert.ToString(dt.Rows[0]["Job"]); motto.Value = Convert.ToString(dt.Rows[0]["Motto"]); realname.Value = Convert.ToString(dt.Rows[0]["Name"]); phone.Value = Convert.ToString(dt.Rows[0]["Tel"]); radlSex.SelectedValue = Convert.ToString(dt.Rows[0]["Sex"]); } username.Value = Convert.ToString(Session["UserName"]); //绑定用户名 dt = MemberManagement.SelectNPX(Convert.ToString(Session["memberId"])); //绑定头像 if (dt.Rows.Count == 1) { pic.Attributes.Add("style", "background-image:url(" + SomeMethod.GetUserPicPath(dt.Rows[0]["picture"]) + ");"); } }
protected void btnLogin_Click(object sender, EventArgs e) { try { //【1】检验验证码是否正确 if (txtIdentifyingCode.Value.ToLower() != Convert.ToString(Session["CheckCode"]).ToLower()) { Msg = "验证码错误"; Response.Write(Msg); return; } //【2】检验账号和密码格式是否正确 Member member = new Member() { MemberId = txtUser.Value.Trim(), Pwd = txtPwd.Value.Trim() }; if (member.IsError) { Msg = "账号或密码错误"; Response.Write(Msg); return; } //【3】检验账号密码是否正确 Member dbMember = MemberManagement.ShowMember(member.MemberId); if (member.MemberId == dbMember.MemberId && member.Pwd == dbMember.Pwd)//若登录成功 { #region 登录处理 //更新客户端cookie if (cbRemember.Checked) { HttpCookie cookie = new HttpCookie("Member"); cookie.Values["MemberId"] = member.MemberId; cookie.Values["Pwd"] = member.Pwd; cookie.Expires = DateTime.Now.AddDays(7); Response.Cookies.Add(cookie); } //将用户角色【管理员,版主或会员】信息存入Session Session["memberId"] = member.MemberId; Session["UserName"] = member.Name; string adminId = AdministratorManagement.SelectId(member.MemberId); if (adminId != null) { Session["role"] = "管理员"; Session["admimId"] = adminId; //Response.Redirect("~/BackgroundPages/Admin.aspx"); } else if ((dt = ModeratorManagement.Select(member.MemberId)).Rows.Count == 1) { Session["role"] = "版主"; Session["moderatorId"] = dt.Rows[0]["moderatorId"]; Session["divisionId"] = dt.Rows[0]["division_id"]; } else { Session["role"] = "会员"; } Response.Redirect("~/Index.aspx"); #endregion } else { Msg = "账号或密码错误"; SomeMethod.PrintMsgToClient(this.ClientScript, Msg); } } catch (Exception) { Msg = "发生一个未知的异常"; SomeMethod.PrintMsgToClient(this.ClientScript, Msg); } }
void Bind() { lvMember.DataSource = MemberManagement.ShowAll(); lvMember.DataBind(); }
protected void ChangePwd_ServerClick(object sender, ImageClickEventArgs e) { string Msg = MemberManagement.UpdatePwd(Convert.ToString(Session["memberId"]), oldPwd.Value.Trim(), newpwd.Value.Trim()); SomeMethod.PrintMsgToClient(this.ClientScript, Msg); }
public MemberManagementBLL() { _management = new MemberManagement(); }
private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e) { UserControl usc = null; bool isAuthorized = false; if (ListViewMenu.SelectedIndex == -1) { return; } switch (((ListViewItem)((ListView)sender).SelectedItem).Name) { case "Book": if (FeatureAttributeService.isAuthorized(typeof(BookManagementControl))) { if (!isShowed(typeof(BookManagementControl))) { usc = new BookManagementControl(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Customer": if (FeatureAttributeService.isAuthorized(typeof(MemberManagement))) { if (!isShowed(typeof(MemberManagement))) { usc = new MemberManagement(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Staff": if (FeatureAttributeService.isAuthorized(typeof(StaffManagement))) { if (!isShowed(typeof(StaffManagement))) { usc = new StaffManagement(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Provider": if (FeatureAttributeService.isAuthorized(typeof(ProviderManagementControl))) { if (!isShowed(typeof(ProviderManagementControl))) { usc = new ProviderManagementControl(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Publisher": if (FeatureAttributeService.isAuthorized(typeof(PublisherManagementControl))) { if (!isShowed(typeof(PublisherManagementControl))) { usc = new PublisherManagementControl(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Category": if (FeatureAttributeService.isAuthorized(typeof(CategoryManagementControl))) { if (!isShowed(typeof(CategoryManagementControl))) { usc = new CategoryManagementControl(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Author": if (FeatureAttributeService.isAuthorized(typeof(AuthorManagementControl))) { if (!isShowed(typeof(AuthorManagementControl))) { usc = new AuthorManagementControl(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; case "Transaction": if (FeatureAttributeService.isAuthorized(typeof(TransactionManagementControl))) { if (!isShowed(typeof(TransactionManagementControl))) { usc = new TransactionManagementControl(); GridMain.Children.Clear(); GridMain.Children.Add(usc); } isAuthorized = true; } break; default: break; } if (!isAuthorized) { MessageBox.Show("You are not authorized for this feature!"); } ListViewMenu.SelectedIndex = -1; }
private static void HandleNextKeyword( KeywordToken keywordToken, List <ParsingUnit> units, IEnumerator <Token> tokens, CompilationContext context) { switch (keywordToken.keyword) { case Keyword.New: { tokens.CautiousAdvance(); Type newObjectType = tokens.ReadType(); IValueGetter[] args = ParseArguments(tokens, context); if (tokens.TestWithoutSkipping(Separator.OpenCurlyBoi)) { Type itemType = newObjectType.GetInitializerItemType(); if (itemType == null) { throw new ScriptParsingException( source: keywordToken, message: $"Initializer Lists only function on collections. " + $"Did you enter the wrong type, or possibly omit a semicolon at the end of the expression?"); } //Initializer Syntax IValueGetter[] items = ParseItems(tokens, itemType, context); units.Add(new ParsedValuedUnit( value: new ConstructInitializedCollectionExpression( objectType: newObjectType, args: args, items: items, source: keywordToken), firstToken: keywordToken)); } else { units.Add(new ParsedValuedUnit( value: new ConstructObjectExpression( objectType: newObjectType, args: args), firstToken: keywordToken)); } } break; case Keyword.System: case Keyword.User: case Keyword.Math: case Keyword.Debug: { tokens.CautiousAdvance(); tokens.AssertAndSkip(Operator.MemberAccess); IdentifierToken identifierToken = tokens.GetTokenAndAdvance <IdentifierToken>(); if (tokens.TestWithoutSkipping(Operator.IsLessThan)) { //Generic Method Type[] internalTypes = tokens.ReadTypeArguments(); units.Add(new ParsedValuedUnit( value: MemberManagement.HandleStaticGenericMethodExpression( keywordToken: keywordToken, args: ParseArguments(tokens, context), identifier: identifierToken.identifier, genericTypes: internalTypes), firstToken: keywordToken)); } else if (tokens.TestWithoutSkipping(Separator.OpenParen)) { //Method units.Add(new ParsedValuedUnit( value: MemberManagement.HandleStaticMethodExpression( keywordToken: keywordToken, args: ParseArguments(tokens, context), identifier: identifierToken.identifier), firstToken: keywordToken)); } else { //Member units.Add(new ParsedValuedUnit( value: MemberManagement.HandleStaticMemberExpression( keywordToken: keywordToken, identifier: identifierToken.identifier), firstToken: keywordToken)); } } break; default: units.Add(new TokenUnit(tokens.Current)); tokens.CautiousAdvance(); break; } }
/// <summary> /// 会员积分修改 /// </summary> /// <param name="memberAccountID">会员账户ID</param> /// <param name="amount">金额</param> /// <param name="costHeadID">结算ID</param> /// <param name="operatorid">操作员ID</param> public void AddScore(int memberAccountID, decimal amount, string costHeadID, int operatorid) { MemberManagement membermanager = NewObject <MemberManagement>(); membermanager.SaveAddScoreList(memberAccountID, amount, 2, costHeadID, operatorid); }