Exemplo n.º 1
0
        public void Execute(WSGuid Ord_GuidID, WSDateTime Ord_DatOrderedOn, WSInt32 Ord_LngCustomerID, WSDecimal Ord_CurTotal)
        {
            Params.spI_tblOrder param = new Params.spI_tblOrder(true);
            param.SetUpConnection(string.Empty);

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

            if (Ord_DatOrderedOn == null || Ord_DatOrderedOn.UseNull)
            {
                param.Param_Ord_DatOrderedOn = SqlDateTime.Null;
            }
            else if (!Ord_DatOrderedOn.UseDefault)
            {
                param.Param_Ord_DatOrderedOn = Ord_DatOrderedOn.Value;
            }

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

            if (Ord_CurTotal == null || Ord_CurTotal.UseNull)
            {
                param.Param_Ord_CurTotal = SqlMoney.Null;
            }
            else if (!Ord_CurTotal.UseDefault)
            {
                param.Param_Ord_CurTotal = Ord_CurTotal.Value;
            }

            using (SPs.spI_tblOrder sp = new SPs.spI_tblOrder(true)) {
                sp.Execute(ref param);
                param.Dispose();
            }
        }
        public Guid Add_tblOrder_Record(Tables.tblOrder_Record record)
        {
            Params.spI_tblOrder param = new Params.spI_tblOrder(true);

            param.SetUpConnection(string.Empty);

            if (record.Col_Ord_DatOrderedOn == null || record.Col_Ord_DatOrderedOn.UseNull)
            {
                param.Param_Ord_DatOrderedOn = SqlDateTime.Null;
            }
            else if (!record.Col_Ord_DatOrderedOn.UseDefault)
            {
                param.Param_Ord_DatOrderedOn = record.Col_Ord_DatOrderedOn.Value;
            }

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

            if (record.Col_Ord_CurTotal == null || record.Col_Ord_CurTotal.UseNull)
            {
                param.Param_Ord_CurTotal = SqlMoney.Null;
            }
            else if (!record.Col_Ord_CurTotal.UseDefault)
            {
                param.Param_Ord_CurTotal = record.Col_Ord_CurTotal.Value;
            }


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

                return(id);
            }
        }