Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>int</returns>
        public static int usp_ServiceInstance_Insert_TCPIP(DI.usp_ServiceInstance_Insert_TCPIPParameters p)
        {
            SqlCommand cmd = DC.NewCmd_usp_ServiceInstance_Insert_TCPIP(p);

            if (p.CheckIsServiceIDChanged())
            {
                object o = p.ServiceID;
                if (o == null)
                {
                    cmd.Parameters["ServiceID"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["ServiceID"].Value = o;
                }
            }
            if (p.CheckIsCreateTimeChanged())
            {
                object o = p.CreateTime;
                if (o == null)
                {
                    cmd.Parameters["CreateTime"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["CreateTime"].Value = o;
                }
            }
            if (p.CheckIsDescriptionChanged())
            {
                object o = p.Description;
                if (o == null)
                {
                    cmd.Parameters["Description"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["Description"].Value = o;
                }
            }
            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);
            }
        }
Esempio n. 2
0
        public static SqlCommand NewCmd_usp_ServiceInstance_Insert_TCPIP(DI.usp_ServiceInstance_Insert_TCPIPParameters p)
        {
            SqlCommand cmd = new SqlCommand("[usp].[ServiceInstance_Insert_TCPIP]");

            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));
            if (p.CheckIsServiceIDChanged())
            {
                cmd.Parameters.Add(new SqlParameter("ServiceID", System.Data.SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "ServiceID", DataRowVersion.Current, null));
            }
            if (p.CheckIsCreateTimeChanged())
            {
                cmd.Parameters.Add(new SqlParameter("CreateTime", System.Data.SqlDbType.DateTime2, 8, ParameterDirection.Input, false, 27, 7, "CreateTime", DataRowVersion.Current, null));
            }
            if (p.CheckIsDescriptionChanged())
            {
                cmd.Parameters.Add(new SqlParameter("Description", System.Data.SqlDbType.NVarChar, -1, ParameterDirection.Input, false, 0, 0, "Description", DataRowVersion.Current, null));
            }
            return(cmd);
        }