Esempio n. 1
0
        public bool UpdateUser(int rowHandle)
        {
            string sql        = "";
            string userCode   = gridView.GetRowCellValue(rowHandle, colUserCode).ToString();
            string userName   = gridView.GetRowCellValue(rowHandle, colUserName).ToString();
            string userPsw    = gridView.GetRowCellValue(rowHandle, colUserPsw).ToString();
            string userKind   = gridView.GetRowCellValue(rowHandle, colUserKind).ToString();
            int    userKindNo = User.GetUserKindNo(userKind);

            if (string.IsNullOrEmpty(userName))
            {
                return(false);
            }
            userPsw = encrypt.EncryptString(userPsw);
            sql     = String.Format("Update T_User Set UserCode = '{0}', UserName='******', UserPsw='{2}',UserRight='{3}'  where UserCode = '{4}'",
                                    userCode.Replace("'", "''"),
                                    userName.Replace("'", "''"),
                                    userPsw.Replace("'", "''"),
                                    userKindNo,
                                    userCode.Replace("'", "''"));
            return(Database.ExecuteSQL(sql, "UserGridView-UpdateUser") == 1 ? true : false);
        }