/// <summary>
 /// 修改操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSure_Click(object sender, EventArgs e)
 {
     if (Encrypt.EncryptStr(txtOldPassword.Text) == App.UserAccount.Password)
     {
         if (txtNewPassword.Text == txtNewPasswordAgin.Text)
         {
             if (App.UserAccount.CurrentSelectRole != null)
             {
                 /*
                  * 正式账号修改
                  */
                 App.ExecuteSQL("update t_account set PASSWORD='******' where ACCOUNT_ID=" + App.UserAccount.Account_id + "");
                 App.SynchronizationDataBase(App.CurrentHospitalId.ToString(), "update t_account set PASSWORD='******' where ACCOUNT_ID=" + App.UserAccount.Account_id + "");
             }
             else
             {
                 /*
                  * 临时账号的修改
                  */
                 App.ExecuteSQL("update T_TEMP_ACCOUNT set PASSWORD='******' where ACCOUNT_ID=" + App.UserAccount.Account_id + "");
                 App.SynchronizationDataBase(App.CurrentHospitalId.ToString(), "update T_TEMP_ACCOUNT set PASSWORD='******' where ACCOUNT_ID=" + App.UserAccount.Account_id + "");
             }
             App.Msg("修改成功!");
         }
         else
         {
             App.MsgErr("新密码两次输入不一致!");
             txtNewPassword.Text     = "";
             txtNewPasswordAgin.Text = "";
             txtNewPassword.Focus();
         }
     }
     else
     {
         App.MsgErr("原密码不正确!");
         txtOldPassword.Text     = "";
         txtNewPassword.Text     = "";
         txtNewPasswordAgin.Text = "";
         txtOldPassword.Focus();
     }
 }
Example #2
0
        /// <summary>
        /// 保存签名
        /// </summary>
        /// <param name="Type">类型</param>
        /// <param name="account">帐号</param>
        /// <param name="pass">密码</param>
        private void SaveSign(string Type, string account, string pass)
        {
            if (Type == "S" && Userid != "")
            {
                DataSet ds_old_account = App.GetDataSet("select a.account_id from T_ACCOUNT a where a.ACCOUNT_NAME='" + txtAccount.Text.ToUpper() + "' and a.PASSWORD='******'");
                if (ds_old_account != null)
                {
                    if (ds_old_account.Tables[0].Rows.Count < 1)
                    {
                        App.Msg("原密码或帐号不正确!");
                        return;
                    }
                }
                else
                {
                    App.Msg("原密码或帐号不正确!");
                    return;
                }
            }


            App.DocSign = null;
            string sqltype = "select a.role_type,t.kind from T_ROLE a inner join T_ACC_ROLE b on a.role_id=b.role_id inner join T_account t on b.account_id=t.account_id  where t.account_name='" + account + "'";

            DataSet dsettype = App.GetDataSet(sqltype);

            if (dsettype.Tables[0].Rows.Count > 0)
            {
                if (dsettype.Tables[0].Rows[0][0].ToString().Trim() != "D")
                {
                    App.MsgWaring("该帐号不是医生帐号!");
                    return;
                }
            }
            else
            {
                if (STYPE == "S")
                {
                    this.txtNewPassword.Text = "";
                    this.txtNewAccount.Focus();
                }
                else
                {
                    this.txtPassword.Text = "";
                    this.txtAccount.Focus();
                }
                App.Msg("工号或密码不正确!");
                return;
            }

            string AccountType = dsettype.Tables[0].Rows[0][1].ToString().Trim();

            if (Type != "S")
            {
                if (AccountType != "52")
                {
                    if (AccountType == "53")
                    {
                        App.Msg("该帐号是实习生帐号,不能审签他人文书!");
                        return;
                    }
                    else if (AccountType == "54")
                    {
                        App.Msg("该帐号是进修生帐号,不能审签他人文书!");
                        return;
                    }
                    else if (AccountType == "70")
                    {
                        App.Msg("该帐号是轮转医生帐号,不能审签他人文书!");
                        return;
                    }
                    else if (AccountType == "7921")
                    {
                        App.Msg("该帐号是研究生帐号,不能审签他人文书!");
                        return;
                    }
                }
            }


            Sql = "select c.user_id,c.user_name,c.u_tech_post,d1.name as u_tech_post_name,c.u_position,d2.name as u_position_name from T_ACCOUNT a inner join t_account_user b on a.account_id=b.account_id inner join T_USERINFO c on b.user_id=c.user_id inner join T_DATA_CODE d1 on c.u_tech_post=d1.id inner join T_DATA_CODE d2 on c.u_position=d2.id where a.ACCOUNT_NAME='" + account + "' and a.PASSWORD='******'";

            DataSet ds = App.GetDataSet(Sql);

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    App.DocSign                  = new Class_DocSign();
                    App.DocSign.Userid           = ds.Tables[0].Rows[0]["user_id"].ToString();
                    App.DocSign.Username         = ds.Tables[0].Rows[0]["user_name"].ToString();
                    App.DocSign.U_tech_post      = ds.Tables[0].Rows[0]["u_tech_post"].ToString();
                    App.DocSign.U_tech_post_name = ds.Tables[0].Rows[0]["u_tech_post_name"].ToString();
                    App.DocSign.U_position       = ds.Tables[0].Rows[0]["u_position"].ToString();
                    App.DocSign.U_position_name  = ds.Tables[0].Rows[0]["u_position_name"].ToString();
                    this.Close();
                }
                else
                {
                    if (STYPE == "S")
                    {
                        this.txtNewPassword.Text = "";
                        this.txtNewAccount.Focus();
                    }
                    else
                    {
                        this.txtPassword.Text = "";
                        this.txtAccount.Focus();
                    }
                    App.Msg("工号或密码不正确!");
                }
            }
            else
            {
                if (STYPE == "S")
                {
                    this.txtNewPassword.Text = "";
                    this.txtNewAccount.Focus();
                }
                else
                {
                    this.txtPassword.Text = "";
                    this.txtAccount.Focus();
                }
                App.Msg("工号或密码不正确!");
            }
        }