示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>int</returns>
        public static int usp_ServiceInstance_Insert_NamedPipe(DI.usp_ServiceInstance_Insert_NamedPipeParameters p)
        {
            SqlCommand cmd = DC.NewCmd_usp_ServiceInstance_Insert_NamedPipe(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);
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>int</returns>
        public static int usp_ServiceInstance_Insert_NamedPipe(int?ServiceID, System.DateTime?CreateTime, string Description)
        {
            SqlCommand cmd = DC.NewCmd_usp_ServiceInstance_Insert_NamedPipe();

            if (ServiceID == null)
            {
                cmd.Parameters["ServiceID"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["ServiceID"].Value = ServiceID;
            }
            if (CreateTime == null)
            {
                cmd.Parameters["CreateTime"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["CreateTime"].Value = CreateTime;
            }
            if (Description == null)
            {
                cmd.Parameters["Description"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["Description"].Value = Description;
            }
            SQLHelper.ExecuteNonQuery(cmd);
            string s = cmd.Parameters["RETURN_VALUE"].Value.ToString();

            if (string.IsNullOrEmpty(s))
            {
                return(0);
            }
            return(int.Parse(s));
        }