public override DataSet Clone()
        {
            OnlineOrderingSchema cln = ((OnlineOrderingSchema)(base.Clone()));

            cln.InitVars();
            return(cln);
        }
Пример #2
0
            public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs)
            {
                System.Xml.Schema.XmlSchemaComplexType type     = new System.Xml.Schema.XmlSchemaComplexType();
                System.Xml.Schema.XmlSchemaSequence    sequence = new System.Xml.Schema.XmlSchemaSequence();
                OnlineOrderingSchema ds = new OnlineOrderingSchema();

                xs.Add(ds.GetSchemaSerializable());
                System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "OnlineOrderingDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                return(type);
            }
Пример #3
0
        public override System.Data.DataSet Clone()
        {
            OnlineOrderingSchema cln = ((OnlineOrderingSchema)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
        /// <summary>
        /// Returns a data set with max account balance and past due amount info
        /// </summary>
        /// <param name="siteId"></param>
        /// <returns></returns>
        public OnlineOrderingSchema.OnlineOrderingRow GetOnlineOrderingInfo(int siteId)
        {
            try
            {
                using (SqlConnection conn = new SqlConnection(_connectionString))
                {
                    //create cmd
                    using (SqlCommand cmd = new SqlCommand("spGetOnlineOrderingInfo", conn))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;

                        //set params
                        cmd.Parameters.Add("@siteId", SqlDbType.Int).Value = siteId;

                        //open conn
                        if (conn.State == ConnectionState.Closed)
                        {
                            try { conn.Open(); }
                            catch (Exception exx)
                            {
                                throw new LogonException(exx);
                            }
                        }
                        else
                        {
                            conn.Close();
                            try { conn.Open(); }
                            catch { throw new LogonException(); }
                        }


                        // build the data adapter
                        using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                        {
                            // create the dataset to fill
                            OnlineOrderingSchema ds = new OnlineOrderingSchema();
                            // now fill it
                            da.Fill(ds.OnlineOrdering);

                            // all done, return
                            return(ds.OnlineOrdering.Count == 1 ? ds.OnlineOrdering[0] : null);
                        }
                    }
                }
            }
            catch (DataSourceException)
            {
                //just rethrow
                throw;
            }
            catch (Exception ex)
            {
                //throw DataSourceException
                throw new DataSourceException(ex);
            }
        }
Пример #5
0
        public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs)
        {
            OnlineOrderingSchema ds = new OnlineOrderingSchema();

            System.Xml.Schema.XmlSchemaComplexType type     = new System.Xml.Schema.XmlSchemaComplexType();
            System.Xml.Schema.XmlSchemaSequence    sequence = new System.Xml.Schema.XmlSchemaSequence();
            xs.Add(ds.GetSchemaSerializable());
            System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            return(type);
        }