void LoadDataToChartProduct()
        {
            DataSet dt = TextUtils.GetListDataFromSP("spGetChartProductData", "A", new string[] { "@numberOfProduct" }, new object[] { 0 });

            if (dt.Tables.Count < 2)
            {
                return;
            }
            //  Chong' timer khi refresh se chay tren 1 luong rieng biet nen se gay loi Index of out bound

            chartControl2.Series[0].DataSource         = dt.Tables[0];
            chartControl2.Series[0].ArgumentScaleType  = ScaleType.Auto;
            chartControl2.Series[0].ArgumentDataMember = "KnifeCode";
            chartControl2.Series[0].ValueScaleType     = ScaleType.Numerical;
            chartControl2.Series[0].ValueDataMembers.AddRange(new string[] { "Quantity" });


            chartControl2.Series[1].DataSource         = dt.Tables[1];
            chartControl2.Series[1].ArgumentScaleType  = ScaleType.Auto;
            chartControl2.Series[1].ArgumentDataMember = "KnifeCode";
            chartControl2.Series[1].ValueScaleType     = ScaleType.Numerical;
            chartControl2.Series[1].ValueDataMembers.AddRange(new string[] { "STD" });

            chartControl2.Series[2].DataSource         = dt.Tables[1];
            chartControl2.Series[2].ArgumentScaleType  = ScaleType.Auto;
            chartControl2.Series[2].ArgumentDataMember = "KnifeCode";
            chartControl2.Series[2].ValueScaleType     = ScaleType.Numerical;
            chartControl2.Series[2].ValueDataMembers.AddRange(new string[] { "ATC" });
            GetDetailToChart(dt.Tables[0]);
        }
Example #2
0
        private void LoadDataTestlerByOrder(string order)
        {
            // load data từ store
            DataSet dts = TextUtils.GetListDataFromSP("spGetResultData_ByOrderCode"
                                                      , new string[1] {
                "@OrderCode"
            }
                                                      , new object[1] {
                order
            });
            DataTable dataTable0 = new DataTable();
            DataTable dataTable1 = new DataTable();

            if (dts.Tables.Count > 1)
            {
                dataTable0 = dts.Tables[0];
                dataTable1 = dts.Tables[1];
            }

            // kieeemr tra table 0
            if (dataTable0.Rows.Count > 0)
            {
                //nếu có thì binding dữ liệu vào các control dạng text
                txtOrderNo.Text      = _Order;
                txtWorkerName.Text   = TextUtils.ToString(dataTable0.Rows[0]["WorkerCode"]);
                txtHYP.Text          = TextUtils.ToString(dataTable0.Rows[0]["HypCode"]);
                txtQty.Text          = TextUtils.ToString(dataTable0.Rows[0]["Qty"]);
                dteNgayGiaCong.Value = TextUtils.ToDate3(dataTable0.Rows[0]["DateLR"]);
                txtBatch.Text        = TextUtils.ToString(dataTable0.Rows[0]["Batch"]);
                txtConfirmer.Text    = TextUtils.ToString(dataTable0.Rows[0]["Confirmer"]);
                lblTester.Text       = TextUtils.ToString(dataTable0.Rows[0]["TesterName"]);
                _sttStart            = (TextUtils.ToInt(dataTable0.Rows[0]["SttStart"]));
                _hypCode             = txtHYP.Text.Trim();
                loadGear(_hypCode);
                GenerateByQty();

                //binding table 1 vào grid
                if (dataTable1.Rows.Count > 0)
                {
                    bindingDataRow(dataTable1);
                    checkAudioImageExist();
                }
            }
            else
            {
                // focus khi không load đc order trong db
                txtConfirmer.Focus();
            }
        }