Beispiel #1
0
        //更新状态
        public int UpdateStatus(string strID, int iStatus, int iType)
        {
            string SqlTxt = "";
            int    iRetu  = 0;

            //if (iType == 1)  //更新logininfotab表
            //{
            //    SqlTxt = "update logininfotab  set enable=@iStatus where loginname=@strID";
            //}
            if (iType == 2) //更新employeeinfotab表
            {
                SqlTxt = "update employeeinfotab  set enable=@iStatus where loginname=@strID";
            }

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = SqlTxt;
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("@iStatus", SqlDbType.Int).Value   = iStatus;
            cmd.Parameters.Add("@strID", SqlDbType.VarChar).Value = strID;

            try
            {
                iRetu = DbHelperSQL.ExecSqlNonQuery(cmd);
            }
            catch (SqlException err)
            {
                throw err;
            }
            return(iRetu);
        }