protected void bt_OK_Click(object sender, EventArgs e) { Rpt_DataSourceBLL _bll; if ((Guid)ViewState["ID"] != Guid.Empty) { //修改 _bll = new Rpt_DataSourceBLL((Guid)ViewState["ID"]); } else { //新增 _bll = new Rpt_DataSourceBLL(); } string pre_conn = _bll.Model.ConnectionString; pl_detail.GetData(_bll.Model); #region 判断必填项 #endregion if (_bll.Model.ConnectionString != pre_conn && _bll.Model.ConnectionString != "") { _bll.Model.ConnectionString = DataEncrypter.EncrypteString(_bll.Model.ConnectionString); } if ((Guid)ViewState["ID"] != Guid.Empty) { //修改 if (_bll.Update() == 0) { MessageBox.ShowAndRedirect(this, "修改成功!", "Rpt_DataSourceList.aspx"); } } else { //新增 if (_bll.Add() == 0) { MessageBox.ShowAndRedirect(this, "新增成功!", "Rpt_DataSourceList.aspx"); } } }
protected void bt_OK_Click(object sender, EventArgs e) { CM_DIUsersBLL user = new CM_DIUsersBLL((int)Session["ClientUserID"]); CM_DIMembershipBLL ship = new CM_DIMembershipBLL(user.Model.ShipID); if (!DataEncrypter.Compare(ship.Model.Password, tbx_OrgPassword.Text)) { Literal1.Text = "原密码输入错误!"; } else { ship.Model.Password = DataEncrypter.EncrypteString(tbx_NewPassword.Text); ship.Update(); Literal1.Text = ""; tbx_NewPassword.Text = ""; tbx_OrgPassword.Text = ""; tbx_RePassword.Text = ""; MessageBox.Show(this, "密码修改成功!"); } }