private void Bind() { model = manage.GetModel(Session["AccountID"].ToString()); txtAdress.Text = model.ADRESS; txtDescription.Text = model.DESCRIPTION; txtIDCard.Text = model.EMAIL; txtMail.Text = model.EMAIL; txtPhone.Text = model.PHONE; txtTrueName.Text = model.TRUENAME; }
protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e) { if (e.CommandName == "Reset") { model = new E_Model.Account(); model.ID = Grid1.DataKeys[e.RowIndex][0].ToString(); model.PASSWORDS = E_Common.DEncrypt.DESEncrypt.Encrypt("888888"); bool rs = manage.ResetPwd(model); if (rs != false) { Alert.ShowInParent("提交成功"); BindGrid(); } else { Alert.ShowInParent("提交失败"); } } if (e.CommandName == "Delete") { bool rs = manage.Delete(Grid1.DataKeys[e.RowIndex][0].ToString()); if (rs != false) { Alert.ShowInParent("提交成功"); BindGrid(); } else { Alert.ShowInParent("提交失败"); } } if (e.CommandName == "Approval") { bool rs = manage.UpdateStatus(Grid1.DataKeys[e.RowIndex][0].ToString(), decimal.Parse(Grid1.DataKeys[e.RowIndex][1].ToString())); if (rs != false) { Alert.ShowInParent("提交成功"); BindGrid(); } else { Alert.ShowInParent("提交失败"); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { ds = manage.GetList(" (username = '******' or usercode ='" + txtUserName.Text + "')"); if (txtUserName.Text.Trim() == "") { //Alert.ShowInTop("用户名不能为空"); Response.Write("<script>alert('用户名不能为空');window.location.href=window.location.href</script>"); return; } if (ds.Tables[0].Rows.Count == 1) { if (txtPassword.Text.Trim() == "") { //Alert.ShowInTop("密码不能为空"); Response.Write("<script>alert('密码不能为空');window.location.href=window.location.href</script>"); return; } if (E_Common.DEScrypt.Base64Encrypt(txtPassword.Text) != ds.Tables[0].Rows[0]["passwords"].ToString()) { Response.Write("<script>alert('密码错误');window.location.href=window.location.href</script>"); return; } if (ds.Tables[0].Rows[0]["Status"].ToString() != "1") { Response.Write("<script>alert('该帐号已被禁用');window.location.href=window.location.href</script>"); return; } model = manage.GetModel(ds.Tables[0].Rows[0]["id"].ToString()); Session["User"] = model; Session["AccountID"] = ds.Tables[0].Rows[0]["id"].ToString(); Session["AccountCode"] = ds.Tables[0].Rows[0]["UserCode"].ToString(); Session["AccountName"] = ds.Tables[0].Rows[0]["TrueName"].ToString(); Session["AccountDept"] = ds.Tables[0].Rows[0]["Dept"].ToString(); Response.Redirect("default.aspx"); } else { Response.Write("<script>alert('该登录帐号不存在');window.location.href=window.location.href</script>"); return; } }
protected void btnAdd_Click(object sender, EventArgs e) { model = manage.GetModel(Session["AccountID"].ToString()); if (txtPwd.Text.Trim() == "") { Alert.ShowInTop("密码不能为空"); return; } if (E_Common.DEScrypt.Base64Encrypt(txtPwd.Text.Trim()) != model.PASSWORDS) { Alert.ShowInTop("密码错误"); return; } if (txtNewPwd.Text.Trim() == "") { Alert.ShowInTop("新密码不能为空"); return; } if (txtRePwd.Text.Trim() != txtNewPwd.Text.Trim()) { Alert.ShowInTop("两次密码不一致"); return; } model = new E_Model.Account(); model.ID = Session["AccountID"].ToString(); model.PASSWORDS = E_Common.DEScrypt.Base64Encrypt(txtNewPwd.Text.Trim()); bool rs = manage.UpdatePwd(model); if (rs != false) { Alert.ShowInParent("保存成功。", string.Empty, ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInParent("提交失败"); } }
private void Bind() { model = manage.GetModel(Request["ID"].ToString()); txtUserName.Text = model.USERNAME; txtUserCode.Text = model.USERCODE; txtDeptCode.Text = model.DEPT; txtDept.Text = mDept.GetModel(model.DEPT).DEPTNAME; txtAdress.Text = model.ADRESS; txtDescription.Text = model.DESCRIPTION; txtIDCard.Text = model.EMAIL; txtMail.Text = model.EMAIL; txtPhone.Text = model.PHONE; txtTrueName.Text = model.TRUENAME; ds = new DataSet(); ds = mDuty.GetList(" status = 1"); ddlDuty.DataSource = ds.Tables[0].DefaultView; ddlDuty.DataTextField = "DutyName"; ddlDuty.DataValueField = "ID"; ddlDuty.DataBind(); DataSet source = new DataSet(); source = mAccountDuty.GetList(" accountid = '" + Request["ID"].ToString() + "'"); if (source.Tables[0].Rows.Count > 0) { foreach (FineUI.ListItem DutyItem in ddlDuty.Items) { for (int i = 0; i < source.Tables[0].Rows.Count; i++) { if (source.Tables[0].Rows[i]["DUTYID"].ToString() == DutyItem.Value) { DutyItem.Selected = true; } } } } ds = new DataSet(); ds = mRole.GetList(" status = 1"); ddlRole.DataSource = ds.Tables[0].DefaultView; ddlRole.DataTextField = "RoleName"; ddlRole.DataValueField = "ID"; ddlRole.DataBind(); source = new DataSet(); source = mAccountRole.GetList(" accountid = '" + Request["ID"].ToString() + "'"); if (source.Tables[0].Rows.Count > 0) { foreach (FineUI.ListItem RoleItem in ddlRole.Items) { for (int i = 0; i < source.Tables[0].Rows.Count; i++) { if (source.Tables[0].Rows[i]["ROLEID"].ToString() == RoleItem.Value) { RoleItem.Selected = true; } } } } }