protected void RpListMembers_ItemCommand(object source, RepeaterCommandEventArgs e) { string c = e.CommandName.Trim(); string p = e.CommandArgument.ToString().Trim(); top = ""; fields = "*"; condition = MembersTSql.GetMembersByImid(p); order = ""; DataTable dt = new DataTable(); dt = Members.GetMembersCondition(top, fields, condition, order); switch (c) { #region Delete case "delete": Members.DeleteMembersByIMID(p); GetListMembers(); #region Logs string logAuthor = CookieExtension.GetCookies("LoginSetting"); string logCreateDate = DateTime.Now.ToString(); Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", dt.Rows[0][MembersColumns.vMemberAccount].ToString(), logAuthor, "", logCreateDate + ": " + logAuthor + " xóa thành viên " + dt.Rows[0][MembersColumns.vMemberAccount].ToString()); #endregion break; #endregion #region Edit Status case "lock": string[] fieldsEditStatus = { "iMemberIsLockedOut" }; string[] valuesEditStatus = { "" }; if (dt.Rows[0]["iMemberIsLockedOut"].ToString().Equals("0")) { valuesEditStatus[0] = "1"; Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition); } else { valuesEditStatus[0] = "0"; Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition); } GetListMembers(); #region Logs logAuthor = CookieExtension.GetCookies("LoginSetting"); logCreateDate = DateTime.Now.ToString(); Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", dt.Rows[0][MembersColumns.vMemberAccount].ToString(), logAuthor, "", logCreateDate + ": " + logAuthor + " cập nhật trạng thái thành viên " + dt.Rows[0][MembersColumns.vMemberAccount].ToString()); #endregion break; #endregion #region edit case "edit": Response.Redirect(LinkAdmin.GoAdminItem(CodeApplications.Member, TypePage.UpdateItem, p)); break; #endregion } }
protected void rp_mn_users_ItemCommand(object source, RepeaterCommandEventArgs e) { string c = e.CommandName.Trim(); string p = e.CommandArgument.ToString().Trim(); fields = "*"; DataTable dt = new DataTable(); dt = Members.GetMembersCondition("", MembersColumns.ImemberisapprovedColumn, MembersTSql.GetMembersByImid(p), ""); switch (c) { #region Delete case "delete": Members.DeleteMembersByIMID(p); GetCategories(""); break; #endregion #region Edit Status case "EditStatus": string[] fieldsEditStatus = { "iMemberIsLockedOut" }; string[] valuesEditStatus = { "" }; if (dt.Rows[0]["iMemberIsLockedOut"].ToString().Equals("0")) { valuesEditStatus[0] = "1"; Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition); } else { valuesEditStatus[0] = "0"; Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition); } GetCategories(""); break; #endregion #region edit case "editPassword": Response.Redirect(LinkAdmin.GoAdminItem(CodeApplications.Member, TypePage.UpdateItem, p)); break; #endregion } }
void InitialControlsValue(bool insert) { #region update if (!insert) { btOK.Text = "Đồng ý"; cbTiepTuc.Visible = false; DataTable dt = new DataTable(); dt = Members.GetMembersCondition("1", "*", MembersTSql.GetMembersByImid(imid), ""); tbTenDangNhap.Text = dt.Rows[0][MembersColumns.vMemberAccount].ToString(); tbTenDangNhap.Enabled = false; hdTenDangNhap.Value = SecurityExtension.Encode(dt.Rows[0][MembersColumns.vMemberAccount].ToString()); ltrGhiChuMatKhau.Text = "<div class='GhiChuMatKhau'>Để trống ô mật khẩu nếu không muốn thay đổi</div>"; tbMatKhau.Text = dt.Rows[0][MembersColumns.vMemberPassword].ToString(); tbNhapLaiMatKhau.Text = dt.Rows[0][MembersColumns.vMemberPassword].ToString(); RequiredFieldValidator2.Visible = false; RequiredFieldValidator3.Visible = false; tbEmail.Text = dt.Rows[0][MembersColumns.vMemberEmail].ToString(); tbHoTen.Text = dt.Rows[0][MembersColumns.vMemberName].ToString(); tbNgaySinh.Text = ((DateTime)dt.Rows[0][MembersColumns.dMemberBirthday]).ToString("MM/dd/yyyy"); ddlGioiTinh.SelectedValue = tbTenDangNhap.Text = dt.Rows[0][MembersColumns.vMemberIdentityCard].ToString(); tbDiaChi.Text = dt.Rows[0][MembersColumns.vMemberAddress].ToString(); tbDienThoai.Text = dt.Rows[0][MembersColumns.vMemberPhone].ToString(); tbTrinhDoHocVan.Text = dt.Rows[0][MembersColumns.vMemberEdu].ToString(); tbNgheNghiep.Text = dt.Rows[0][MembersColumns.vMemberJob].ToString(); tbQuanHeXaHoi.Text = dt.Rows[0][MembersColumns.vMemberRelationship].ToString(); tbTenDangNhap.Text = dt.Rows[0][MembersColumns.vMemberAccount].ToString(); tbChieuCao.Text = dt.Rows[0][MembersColumns.VmemberheightColumn].ToString(); tbCanNang.Text = dt.Rows[0][MembersColumns.VmemberweightColumn].ToString(); tbCauGioiThieuNgan.Text = dt.Rows[0][MembersColumns.VmemberblastColumn].ToString(); ddlKichHoat.SelectedValue = dt.Rows[0][MembersColumns.iMemberIsApproved].ToString(); ddlTrangThai.SelectedValue = dt.Rows[0][MembersColumns.iMemberIsLockedOut].ToString(); #region Image if (!dt.Rows[0][MembersColumns.vMemberImage].ToString().Equals("")) { ltimg.Text = ImagesExtension.GetImage(pic, dt.Rows[0][MembersColumns.vMemberImage].ToString(), "", "imgItem", false, false, "", false); lnk_delete_Image_current.Visible = true; } else { ltimg.Visible = false; lnk_delete_Image_current.Visible = false; } hd_img.Value = dt.Rows[0][MembersColumns.vMemberImage].ToString(); #endregion #region Các trường không xuất hiện trên form hdvProperty.Value = dt.Rows[0][MembersColumns.VpropertyColumn].ToString(); hdvMemberYahooNick.Value = dt.Rows[0][MembersColumns.vMemberYahooNick].ToString(); hdvMemberPasswordQuestion.Value = dt.Rows[0][MembersColumns.vMemberPasswordQuestion].ToString(); hdvMemberPasswordAnswer.Value = dt.Rows[0][MembersColumns.vMemberPasswordAnswer].ToString(); hdvMemberComment.Value = dt.Rows[0][MembersColumns.vMemberComment].ToString(); hdiMemberTotalLogin.Value = dt.Rows[0][MembersColumns.ImemberTotalLoginColumn].ToString(); hdiMemberTotalview.Value = dt.Rows[0][MembersColumns.ImembertotalviewColumn].ToString(); #endregion } #endregion #region insert else { tbTenDangNhap.Focus(); } #endregion }