private void btnDel_Click(object sender, ImageClickEventArgs e) { string PKID; int selectedIndex = -1; foreach (DataGridItem item in this.dgUser.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { if (((System.Web.UI.WebControls.RadioButton)item.Cells[0].Controls[1]).Checked) { selectedIndex = item.ItemIndex; break; } } } if (selectedIndex != -1) { PKID = this.dgUser.Items[selectedIndex].Cells[1].Text; Wicresoft.Session.Session session = new Wicresoft.Session.Session(); BusinessMapping.User bo = new BusinessMapping.User(); bo.SessionInstance = session; BusinessFilter filter = new BusinessFilter("User"); filter.AddFilterItem("PKID", PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND); bo.AddFilter(filter); bo.Load(); if (bo.IsReserved.Value) { GlobalFacade.Utils.ShowMessage(Enums.Constants.RecordReserved); } else { bo.ModifyUser.Value = this.MyContext.UserID; bo.ModifyTime.Value = DateTime.Now; bo.IsValid.Value = false; bo.Update(); //BusinessRule.SystemManage.OperationLog rule = new BusinessRule.SystemManage.OperationLog(); //rule.WriteOperationLog("用户信息管理", "删除用户信息"); // Reload Data ucCustomPaging.LoadData(ucCustomPaging.CurrentPage); } } }
/// <summary> /// 更新密码 /// </summary> private void Save() { InputPwd = GlobalFacade.EncryptionManager.EncrytPassword(this.tbxNewPassword.Text.Trim().ToString()); bo.SessionInstance = new Wicresoft.Session.Session(); filter = new BusinessFilter("User"); filter.AddFilterItem("PKID", GlobalFacade.SystemContext.GetContext().UserID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND); bo.AddFilter(filter); bo.Load(); if (bo.HaveRecord) { bo.Password.Value = InputPwd; // 2006-11-20, Tony bo.LastModifyPasswordTime.Value = DateTime.Now; bo.Update(); } }
/// <summary> /// 更新用户主档信息 /// </summary> /// <param name="session"></param> /// <param name="userid"></param> private void UpdateUserInfo(Wicresoft.Session.Session session, int userid) { BusinessMapping.User bo = new BusinessMapping.User(); bo.SessionInstance = session; BusinessFilter filter = new BusinessFilter("User"); filter.AddFilterItem("PKID", userid.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND); bo.AddFilter(filter); bo.Load(); if (bo.HaveRecord) { bo.Alias.Value = this.tbxAlias.Text.Trim(); bo.ChineseName.Value = this.tbxChineseName.Text.Trim(); bo.EnglishName.Value = this.tbxEnglishName.Text.Trim(); bo.Gender.Value = Convert.ToBoolean(this.rbtnGender.SelectedValue); bo.IsActive.Value = this.cbxIsActive.Checked; if (this.gpRole.SelectedValue != string.Empty && this.gpRole.SelectedValue != "0") { bo.FK_Role.Value = Convert.ToInt32(this.gpRole.SelectedValue); } bo.Title.Value = this.tbxTitle.Text.Trim(); bo.Mobile.Value = this.tbxMobile.Text.Trim(); bo.Email.Value = this.tbxEmail.Text.Trim(); bo.Address.Value = this.tbxAddress.Text.Trim(); if (this.tbxBirthday.Text.Trim() != string.Empty) { bo.Birthday.Value = Convert.ToDateTime(this.tbxBirthday.Text.Trim()); } bo.Memo.Value = this.tbxMemo.Text.Trim(); bo.ModifyTime.Value = DateTime.Now; bo.ModifyUser.Value = GlobalFacade.SystemContext.GetContext().UserID; bo.Update(); } }
private void Save() { string InputPwd = EncryptionManager.EncrytPassword(this.tbxNewPassword.Text.Trim().ToString()); bo = new BusinessMapping.User(); bo.SessionInstance = new Wicresoft.Session.Session(); filter = new BusinessFilter("User"); filter.AddFilterItem("PKID", userid, Operation.Equal, FilterType.NumberType, AndOr.AND); bo.AddFilter(filter); bo.Load(); if (bo.HaveRecord) { bo.Password.Value = InputPwd; // 2006-11-20, Tony bo.LastModifyPasswordTime.Value = DateTime.Now; bo.Update(); GlobalFacade.Utils.ShowMessageUrl("提示:您的密码已经成功更新...", "UserList.aspx"); } }