Ejemplo n.º 1
0
        public void Execute(WSInt32 Cat_LngID, WSString Cat_StrName, WSBoolean ConsiderNull_Cat_StrName)
        {
            Params.spU_tblCategory param = new Params.spU_tblCategory(true);
            param.SetUpConnection(string.Empty);

            if (Cat_LngID == null || Cat_LngID.UseNull)
            {
                param.Param_Cat_LngID = SqlInt32.Null;
            }
            else if (!Cat_LngID.UseDefault)
            {
                param.Param_Cat_LngID = Cat_LngID.Value;
            }

            if (Cat_StrName == null || Cat_StrName.UseNull)
            {
                param.Param_Cat_StrName = SqlString.Null;
            }
            else if (!Cat_StrName.UseDefault)
            {
                param.Param_Cat_StrName = Cat_StrName.Value;
            }

            if (ConsiderNull_Cat_StrName == null || ConsiderNull_Cat_StrName.UseNull)
            {
                param.Param_ConsiderNull_Cat_StrName = SqlBoolean.Null;
            }
            else if (!ConsiderNull_Cat_StrName.UseDefault)
            {
                param.Param_ConsiderNull_Cat_StrName = ConsiderNull_Cat_StrName.Value;
            }

            using (SPs.spU_tblCategory sp = new SPs.spU_tblCategory(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
Ejemplo n.º 2
0
        public void Edit_Category(Tables.Category record)
        {
            Params.spU_tblCategory param = new Params.spU_tblCategory(false);

            param.SetUpConnection(string.Empty);

            param.Param_Cat_LngID = record.Col_Cat_LngID.Value;

            if (record.Col_Cat_StrName == null || record.Col_Cat_StrName.UseNull)
            {
                param.Param_ConsiderNull_Cat_StrName = true;
                param.Param_Cat_StrName = SqlString.Null;
            }
            else if (!record.Col_Cat_StrName.UseDefault)
            {
                param.Param_Cat_StrName = record.Col_Cat_StrName.Value;
            }


            using (SPs.spU_tblCategory sp = new SPs.spU_tblCategory(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }