Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>int</returns>
        public static int usp_Service_Update(DI.usp_Service_UpdateParameters p)
        {
            SqlCommand cmd = DC.NewCmd_usp_Service_Update(p);

            if (p.CheckIsOriginal_ServiceIDChanged())
            {
                object o = p.Original_ServiceID;
                if (o == null)
                {
                    cmd.Parameters["Original_ServiceID"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["Original_ServiceID"].Value = o;
                }
            }
            if (p.CheckIsServiceTypeIDChanged())
            {
                object o = p.ServiceTypeID;
                if (o == null)
                {
                    cmd.Parameters["ServiceTypeID"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["ServiceTypeID"].Value = o;
                }
            }
            if (p.CheckIsNameChanged())
            {
                object o = p.Name;
                if (o == null)
                {
                    cmd.Parameters["Name"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["Name"].Value = o;
                }
            }
            if (p.CheckIsVersionChanged())
            {
                object o = p.Version;
                if (o == null)
                {
                    cmd.Parameters["Version"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["Version"].Value = o;
                }
            }
            if (p.CheckIsFilePathChanged())
            {
                object o = p.FilePath;
                if (o == null)
                {
                    cmd.Parameters["FilePath"].Value = DBNull.Value;
                }
                else
                {
                    cmd.Parameters["FilePath"].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);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>int</returns>
        public static int usp_Service_Update(int?Original_ServiceID, int?ServiceTypeID, string Name, int?Version, string FilePath, string Description)
        {
            SqlCommand cmd = DC.NewCmd_usp_Service_Update();

            if (Original_ServiceID == null)
            {
                cmd.Parameters["Original_ServiceID"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["Original_ServiceID"].Value = Original_ServiceID;
            }
            if (ServiceTypeID == null)
            {
                cmd.Parameters["ServiceTypeID"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["ServiceTypeID"].Value = ServiceTypeID;
            }
            if (Name == null)
            {
                cmd.Parameters["Name"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["Name"].Value = Name;
            }
            if (Version == null)
            {
                cmd.Parameters["Version"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["Version"].Value = Version;
            }
            if (FilePath == null)
            {
                cmd.Parameters["FilePath"].Value = DBNull.Value;
            }
            else
            {
                cmd.Parameters["FilePath"].Value = FilePath;
            }
            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));
        }