示例#1
0
        public bool UpdateChart(QCChart chart)
        {
            Console.WriteLine("ChartDAL-UpdateChart():" + DateTime.Now.ToString());

            try
            {
                QCChart selectChart = db.Select <QCChart>(new QCChart
                {
                    SampleName = chart.SampleName,
                    MaterialNo = chart.MaterialNo,
                    LineNo     = chart.LineNo,
                    Property   = chart.Property,
                    Date       = chart.Date
                });

                selectChart.LastModify = DateTime.Now;

                return(db.Update(selectChart));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw new Exception(e.Message);
            }
        }
示例#2
0
 public void AddContractor()
 {
     count             = 0;
     strBuilder.Length = 0;
     foreach (DataRow row in table.Rows)
     {
         string  msg      = "";
         QCChart _QCChart = new QCChart
         {
             SampleName = row["SampleName"].ToString(),
             MaterialNo = row["LOT_NO"].ToString(),
             LineNo     = row["LINE"].ToString(),
             Property   = row["PropertyName"].ToString(),
             Date       = Convert.ToDateTime(row["CreateDate"]),
             UCL        = Convert.ToDecimal(row["UCL"]),
             LCL        = Convert.ToDecimal(row["LCL"])
         };
         try
         {
             biz.AddChartUCL2LCL(_QCChart);
             count++;
         }
         catch (Exception e) {
             strBuilder.Append(row["SampleName"].ToString() + " " + row["PropertyName"].ToString() + ":" + msg + "\n");
         }
     }
 }
示例#3
0
 public bool AddChart(QCChart Chart)
 {
     Console.WriteLine("ChartDAL - AddChart():" + DateTime.Now.ToString());
     try
     {
         return(db.Insert(Chart));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
示例#4
0
 public bool DeleteChart(QCChart chart)
 {
     Console.WriteLine("ChartDAL - DeleteChartUCL2LCL():" + DateTime.Now.ToString());
     try
     {
         QCChart selectchart = db.Select <QCChart>(new QCChart {
             SampleName = chart.SampleName, Property = chart.Property
         });
         return(db.Delete(selectchart));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
示例#5
0
        void gridView1_Click(object sender, EventArgs e)
        {
            int rowCount = gridView1.SelectedRowsCount;

            if (rowCount != 1)
            {
                return;
            }

            DataRow row = gridView1.GetDataRow(gridView1.GetSelectedRows()[0]);

            SelectedChart = new QCChart {
                SampleName = row["SampleName"].ToString(), Property = row["PropertyName"].ToString()
            };
        }
示例#6
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);
             }
         }
     }
 }
 public bool DeleteChartUCL2LCL(QCChart Chart)
 {
     return(proxy.DeleteChart(Chart));
 }
 public bool UpdateChartUCL2LCL(QCChart Chart)
 {
     return(proxy.UpdateChart(Chart));
 }
 public bool AddChartUCL2LCL(QCChart Chart)
 {
     return(proxy.AddChart(Chart));
 }