예제 #1
0
        public bool GetData()
        {
            try
            {
                OpenDialog.Filter = "Excel(*.xls)|*.xls";
                OpenDialog.Title  = CultureLanuage.Translator(this.Name, 12, "Import From Excel");
                if (OpenDialog.ShowDialog() == DialogResult.OK)
                {
                    if (string.IsNullOrEmpty(OpenDialog.FileName))
                    {
                        return(false);
                    }

                    GetDataFromExcel();

                    if (bw.IsBusy)
                    {
                        return(false);
                    }

                    bw.RunWorkerAsync();
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #2
0
        private void QE31_Load(object sender, EventArgs e)
        {
            if (IsLanguage)
            {
                #region Language

                this.TabText = CultureLanuage.Translator(this.Name, 0, "Result Input [QE31]");
                DataSet   dsgrid   = CultureLanuage.ApplyResourcesFrom(_QE31View, "QE31", "QE31View");
                DataTable gridData = CultureLanuage.GridHeader(dsgrid, "gridView1");
                if (gridData != null)
                {
                    _QE31View.gridControl1.DataSource = gridData;
                    CultureLanuage.GridResourcesFrom(_QE31View.gridView1, "gridView1", dsgrid);
                    _QE31View.gridView1.BestFitColumns();
                }

                gridData = CultureLanuage.GridHeader(dsgrid, "gridView2");
                if (gridData != null)
                {
                    _QE31View.gridControl2.DataSource = gridData;
                    CultureLanuage.GridResourcesFrom(_QE31View.gridView2, "gridView2", dsgrid);
                    _QE31View.gridView2.BestFitColumns();
                }

                #endregion
            }
        }
예제 #3
0
 void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (count == table.Rows.Count)
     {
         MessageBox.Show(CultureLanuage.Translator(this.Name, 10, "Successfully import all the data.."));
     }
     else
     {
         MessageBox.Show(CultureLanuage.Translator(this.Name, 11, "Data import faild: ") + strBuilder.ToString());
     }
 }
예제 #4
0
        void _SPC1View_eventShowDetails(object sender, EventArgs e)
        {
            EgateArgs args = (EgateArgs)e;

            _SPC1Dialog.Clear();

            _SPC1Dialog.Chart = new QCChart
            {
                SampleName = (string)args.EgateDictionary["SampleName"],
                MaterialNo = (string)args.EgateDictionary["LOT_NO"],
                LineNo     = (string)args.EgateDictionary["LINE"],
                Property   = (string)args.EgateDictionary["PropertyName"],
                UCL        = (decimal)args.EgateDictionary["UCL"],
                LCL        = (decimal)args.EgateDictionary["LCL"],
                Date       = (DateTime)args.EgateDictionary["CreateDate"],
                Remark     = (string)args.EgateDictionary["Remark"]
            };
            _SPC1Dialog._STEP = STEP.Edit;

            _SPC1Dialog.ShowDialog();

            if (_SPC1Dialog.rValue)
            {
                string msg = _SPC1Dialog.ReadyWork;
                if (string.IsNullOrEmpty(msg))
                {
                    if (!biz.UpdateChartUCL2LCL(_SPC1Dialog.Chart))
                    {
                        WriteTips(5, CultureLanuage.Translator(this.Name, 8, "Update ChartUCL2LCL Error!"));
                    }
                    else
                    {
                        WriteTips(5, CultureLanuage.Translator(this.Name, 9, "Update Control Line: {0} - {1} succesfull!", _SPC1Dialog.Chart.SampleName, _SPC1Dialog.Chart.Property));
                        Query();
                    }
                }
                else
                {
                    MessageBox.Show(msg);
                    WriteTips(5, msg);
                }
            }
        }
예제 #5
0
 public void DeleteCL(QCChart Chart)
 {
     if (string.IsNullOrEmpty(Chart.SampleName) || string.IsNullOrEmpty(Chart.Property))
     {
         WriteTips(5, CultureLanuage.Translator(this.Name, 3, "Please select both SampleName and Property"), Color.Red);
         return;
     }
     else
     {
         if (Infrastructure.ConfirmBox.Show(CultureLanuage.Translator(this.Name, 5, "Confirm Delete"), CultureLanuage.Translator(this.Name, 4, "Confirm to Delete Property : {0} - {1} ?", Chart.SampleName, Chart.Property)))
         {
             if (biz.DeleteChartUCL2LCL(Chart))
             {
                 Query();
                 WriteTips(5, CultureLanuage.Translator(this.Name, 6, "Property : {0} - {1}, has been deleted!", Chart.SampleName, Chart.Property));
             }
             else
             {
                 WriteTips(5, CultureLanuage.Translator(this.Name, 7, "Error! Can not delete Property : {0} - {1}!", Chart.SampleName, Chart.Property), Color.Red);
             }
         }
     }
 }
예제 #6
0
        public void AddCL()
        {
            _SPC1Dialog.Clear();
            _SPC1Dialog._STEP = STEP.Add;
            if (string.IsNullOrEmpty(_SPC1View.Sample) || string.IsNullOrEmpty(_SPC1View.LOT_NO) || string.IsNullOrEmpty(_SPC1View.LINE))
            {
                MessageBox.Show(CultureLanuage.Translator(this.Name, 1, "Please pick SampleName, LOT_NO and LINE!"));
                return;
            }

            _SPC1Dialog.Chart = new QCChart {
                SampleName = _SPC1View.Sample, MaterialNo = _SPC1View.LOT_NO, LineNo = _SPC1View.LINE, Date = DateTime.Now
            };
            _SPC1Dialog.ShowDialog();
            if (_SPC1Dialog.rValue)
            {
                string msg = _SPC1Dialog.ReadyWork;
                if (string.IsNullOrEmpty(msg))
                {
                    if (!biz.AddChartUCL2LCL(_SPC1Dialog.Chart))
                    {
                        WriteTips(5, "Error", Color.Red);
                    }
                    else
                    {
                        WriteTips(5, CultureLanuage.Translator(this.Name, 2, "Added Control Line Successful!"));
                        Query();
                    }
                }
                else
                {
                    MessageBox.Show(msg);
                    WriteTips(5, msg, Color.Red);
                }
            }
        }
예제 #7
0
 string Translator(int ID, string Note)
 {
     return(CultureLanuage.Translator("SPC1", ID, Note));
 }