Пример #1
0
        private void DrawAdrTableBody(AISTOCK_STOCK_ADR_INDEX_V_DATA data)
        {
            if (data == null)
            {
                return;
            }
            if (data.AISTOCK_STOCK_ADR_INDEX.Count <= 0)
            {
                return;
            }
            TableRow bodyRow;

            bodyRow = this.BmBlafTable.AddBodyRow();
            DataRow[] row = data.AISTOCK_STOCK_ADR_INDEX.Select("DSC = 'INCREASE'");
            AISTOCK_STOCK_ADR_INDEX_V_DATA.AISTOCK_STOCK_ADR_INDEXRow increase = (AISTOCK_STOCK_ADR_INDEX_V_DATA.AISTOCK_STOCK_ADR_INDEXRow)row[0];
            row = data.AISTOCK_STOCK_ADR_INDEX.Select("DSC = 'DECREASE'");
            AISTOCK_STOCK_ADR_INDEX_V_DATA.AISTOCK_STOCK_ADR_INDEXRow decrease = (AISTOCK_STOCK_ADR_INDEX_V_DATA.AISTOCK_STOCK_ADR_INDEXRow)row[0];
            decimal totalIncrease = increase.TOTAL;
            decimal totalDecrease = decrease.TOTAL;
            decimal percent       = 0;

            if (totalDecrease != 0)
            {
                percent = totalIncrease / totalDecrease;
            }
            this.BmBlafTable.AddCell(bodyRow, totalIncrease.ToString(), HorizontalAlign.Left);
            this.BmBlafTable.AddCell(bodyRow, totalDecrease.ToString(), HorizontalAlign.Left);
            this.BmBlafTable.AddCell(bodyRow, percent.ToString(), HorizontalAlign.Left);
        }
Пример #2
0
        public override global::System.Data.DataSet Clone()
        {
            AISTOCK_STOCK_ADR_INDEX_V_DATA cln = ((AISTOCK_STOCK_ADR_INDEX_V_DATA)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Пример #3
0
        public AISTOCK_STOCK_ADR_INDEX_V_DATA GetStockAdrData(string dateFrom, string dateTo, string code)
        {
            AISTOCK_STOCK_ADR_INDEX_V_DATA data = new AISTOCK_STOCK_ADR_INDEX_V_DATA();

            using (DaStock da = new DaStock())
            {
                da.LoadADRIndex(data.AISTOCK_STOCK_ADR_INDEX, dateFrom, dateTo);
            }
            return(data);
        }
Пример #4
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            AISTOCK_STOCK_ADR_INDEX_V_DATA ds = new AISTOCK_STOCK_ADR_INDEX_V_DATA();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Пример #5
0
        private void Refresh()
        {
            StockQueryCondition qc = new StockQueryCondition();

            qc.DeserializeFromString(this.ViewState["_StockQueryCondition"].ToString());
            this.labPrompt.Text = "";

            int indexDay = 14;

            if (qc.Index.Equals("RSI(5)"))
            {
                indexDay = 5;
            }
            else if (qc.Index.Equals("RSI(9)"))
            {
                indexDay = 9;
            }
            else if (qc.Index.Equals("RSI(14)") || qc.Index.Equals("ADR(14)"))
            {
                indexDay = 11;
            }
            else if (qc.Index.Equals("WMS(10)") || qc.Index.Equals("ADR(10)"))
            {
                indexDay = 10;
            }
            else if (qc.Index.Equals("WMS(20)"))
            {
                indexDay = 20;
            }

            string dateTo = DateTimeFunction.ConvertDate(qc.DatePickerFrom);

            string date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay);

            date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString());

            AISTOCK_STOCK_STATS_DATA stockData = new StockSystem().GetStockData(dateTo, txtStockCode.Text.Trim());

            if (qc.Index.Equals("RSI(5)") || qc.Index.Equals("RSI(9)") || qc.Index.Equals("RSI(14)"))
            {
                string today = DateTimeFunction.ConvertDate(DateTime.Now.ToShortDateString());
                today = new StockSystem().GetToday(today);
                bool flag = false;
                if (int.Parse(dateTo) < int.Parse(today))
                {
                    flag = true;
                }
                AISTOCK_STOCK_INDEX_V_DATA dataRSI = new AISTOCK_STOCK_INDEX_V_DATA();
                dataRSI = new StockSystem().GetStockDataIndex(date, dateTo, txtStockCode.Text.Trim());

                this.BmBlafTable.Clear();
                DrawRsiTableHeader();
                DrawRsiTableBody(dataRSI, stockData, txtStockCode.Text.Trim(), flag, today, qc.DatePickerFrom, indexDay);
            }
            else if (qc.Index.Equals("WMS(10)") || qc.Index.Equals("WMS(20)"))
            {
                AISTOCK_STOCK_WMS_V_DATA dataWms = new AISTOCK_STOCK_WMS_V_DATA();
                dataWms = new StockSystem().GetStockWmsData(date, dateTo, txtStockCode.Text.Trim());

                this.BmBlafTable.Clear();
                DrawWmsTableHeader();
                DrawWmsTableBody(stockData, dataWms);
            }
            else if (qc.Index.Equals("ADR(10)") || qc.Index.Equals("ADR(14)"))
            {
                AISTOCK_STOCK_ADR_INDEX_V_DATA dataAdr = new AISTOCK_STOCK_ADR_INDEX_V_DATA();
                dataAdr = new StockSystem().GetStockAdrData(date, dateTo, txtStockCode.Text.Trim());

                this.BmBlafTable.Clear();
                DrawAdrTableHeader();
                DrawAdrTableBody(dataAdr);
            }
        }
Пример #6
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                AISTOCK_STOCK_ADR_INDEX_V_DATA ds = new AISTOCK_STOCK_ADR_INDEX_V_DATA();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "AISTOCK_STOCK_ADR_INDEXDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }