Exemplo n.º 1
0
        public void Execute(WSGuid Oit_GuidID, WSGuid Oit_GuidOrderID, WSGuid Oit_GuidProductID, WSInt32 Oit_LngAmount)
        {
            Params.spI_tblOrderItem param = new Params.spI_tblOrderItem(true);
            param.SetUpConnection(string.Empty);

            if (Oit_GuidID == null || Oit_GuidID.UseNull)
            {
                param.Param_Oit_GuidID = SqlGuid.Null;
            }
            else if (!Oit_GuidID.UseDefault)
            {
                param.Param_Oit_GuidID = Oit_GuidID.Value;
            }

            if (Oit_GuidOrderID == null || Oit_GuidOrderID.UseNull)
            {
                param.Param_Oit_GuidOrderID = SqlGuid.Null;
            }
            else if (!Oit_GuidOrderID.UseDefault)
            {
                param.Param_Oit_GuidOrderID = Oit_GuidOrderID.Value;
            }

            if (Oit_GuidProductID == null || Oit_GuidProductID.UseNull)
            {
                param.Param_Oit_GuidProductID = SqlGuid.Null;
            }
            else if (!Oit_GuidProductID.UseDefault)
            {
                param.Param_Oit_GuidProductID = Oit_GuidProductID.Value;
            }

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

            using (SPs.spI_tblOrderItem sp = new SPs.spI_tblOrderItem(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
Exemplo n.º 2
0
        public Guid Add_tblOrderItem_Record(Tables.tblOrderItem_Record record)
        {
            Params.spI_tblOrderItem param = new Params.spI_tblOrderItem(true);

            param.SetUpConnection(string.Empty);

            if (record.Col_Oit_GuidOrderID == null || record.Col_Oit_GuidOrderID.UseNull)
            {
                param.Param_Oit_GuidOrderID = SqlGuid.Null;
            }
            else if (!record.Col_Oit_GuidOrderID.UseDefault)
            {
                param.Param_Oit_GuidOrderID = record.Col_Oit_GuidOrderID.Value;
            }

            if (record.Col_Oit_GuidProductID == null || record.Col_Oit_GuidProductID.UseNull)
            {
                param.Param_Oit_GuidProductID = SqlGuid.Null;
            }
            else if (!record.Col_Oit_GuidProductID.UseDefault)
            {
                param.Param_Oit_GuidProductID = record.Col_Oit_GuidProductID.Value;
            }

            if (record.Col_Oit_LngAmount == null || record.Col_Oit_LngAmount.UseNull)
            {
                param.Param_Oit_LngAmount = SqlInt32.Null;
            }
            else if (!record.Col_Oit_LngAmount.UseDefault)
            {
                param.Param_Oit_LngAmount = record.Col_Oit_LngAmount.Value;
            }


            using (SPs.spI_tblOrderItem sp = new SPs.spI_tblOrderItem(true)) {
                sp.Execute(ref param);
                Guid id = param.Param_Oit_GuidID.Value;
                param.Dispose();

                return(id);
            }
        }