Example #1
0
        public static SqlCommand NewCmd_usp_ServiceType_SelectAll(DI.usp_ServiceType_SelectAllParameters p)
        {
            SqlCommand cmd = new SqlCommand("[usp].[ServiceType_SelectAll]");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("RETURN_VALUE", System.Data.SqlDbType.Int, 0, ParameterDirection.ReturnValue, false, 0, 0, null, DataRowVersion.Current, null));
            return(cmd);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>int</returns>
        public static int usp_ServiceType_SelectAll(DI.usp_ServiceType_SelectAllParameters p)
        {
            SqlCommand cmd = DC.NewCmd_usp_ServiceType_SelectAll(p);

            SQLHelper.ExecuteNonQuery(cmd);
            string s = cmd.Parameters["RETURN_VALUE"].Value.ToString();

            if (string.IsNullOrEmpty(s))
            {
                p.SetReturnValue(0);
                return(0);
            }
            else
            {
                p.SetReturnValue(int.Parse(s));
                return(p._ReturnValue);
            }
        }