Ejemplo n.º 1
0
 /// <summary>
 /// 增加一条从Lims数据读取的数据
 /// </summary>
 public void Add_Lims(RelayTest.Model.ModelTEST_ALLOCATION model)
 {
     try
     {
         Log.Info("BllTEST_ALLOCATION->Add_Lims---START");
         ConnectionOpen();
         dal.SetDBAccess(GetDBAccess());
         dal.Add_Lims(model);
     }
     catch (Exception ex)
     {
         Log.Error("BllTEST_ALLOCATION->Add_Lims---FAILED", ex);
         throw ex;
     }
     finally
     {
         ConnectionClose();
         Log.Info("BllTEST_ALLOCATION->Add_Lims---finally");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model">相应的数据实体</param>
 /// <returns>真表示有记录被更新,否表示没有记录被更新</returns>
 public bool Update(RelayTest.Model.ModelTEST_ALLOCATION model)
 {
     try
     {
         Log.Info("BllTEST_ALLOCATION->Update---START");
         ConnectionOpen();
         dal.SetDBAccess(GetDBAccess());
         return(dal.Update(model));
     }
     catch (Exception ex)
     {
         Log.Error("BllTEST_ALLOCATION->Update---FAILED", ex);
         throw ex;
     }
     finally
     {
         ConnectionClose();
         Log.Info("BllTEST_ALLOCATION->Update---finally");
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <RelayTest.Model.ModelTEST_ALLOCATION> DataTableToList(DataTable dt)
        {
            try
            {
                Log.Info("BllTEST_ALLOCATION->DataTableToList---START");
                ConnectionOpen();
                dal.SetDBAccess(GetDBAccess());
                List <RelayTest.Model.ModelTEST_ALLOCATION> modelList = new List <RelayTest.Model.ModelTEST_ALLOCATION>();
                int rowsCount = dt.Rows.Count;
                if (rowsCount > 0)
                {
                    RelayTest.Model.ModelTEST_ALLOCATION model;
                    for (int n = 0; n < rowsCount; n++)
                    {
                        model = new RelayTest.Model.ModelTEST_ALLOCATION();
                        model.F_TEST_TASK_ID    = dt.Rows[n]["F_TEST_TASK_ID"].ToString();
                        model.F_TEST_SAMPLE_ID  = dt.Rows[n]["F_TEST_SAMPLE_ID"].ToString();
                        model.F_LOAD_ID         = dt.Rows[n]["F_LOAD_ID"].ToString();
                        model.F_LOAD_CHANNEL_ID = dt.Rows[n]["F_LOAD_CHANNEL_ID"].ToString();
                        if (dt.Rows[n]["F_SAMPLE_STATUS"].ToString() != "")
                        {
                            model.F_SAMPLE_STATUS = decimal.Parse(dt.Rows[n]["F_SAMPLE_STATUS"].ToString());
                        }
                        if (dt.Rows[n]["F_MAKING_CURRENT"].ToString() != "")
                        {
                            model.F_MAKING_CURRENT = decimal.Parse(dt.Rows[n]["F_MAKING_CURRENT"].ToString());
                        }
                        if (dt.Rows[n]["F_BREAK_CURRENT"].ToString() != "")
                        {
                            model.F_BREAK_CURRENT = decimal.Parse(dt.Rows[n]["F_BREAK_CURRENT"].ToString());
                        }
                        if (dt.Rows[n]["F_FAILURE_CYCLE"].ToString() != "")
                        {
                            model.F_FAILURE_CYCLE = decimal.Parse(dt.Rows[n]["F_FAILURE_CYCLE"].ToString());
                        }
                        if (dt.Rows[n]["F_TEST_CYCLE"].ToString() != "")
                        {
                            model.F_TEST_CYCLE = decimal.Parse(dt.Rows[n]["F_TEST_CYCLE"].ToString());
                        }
                        model.F_MEMO = dt.Rows[n]["F_MEMO"].ToString();
                        if (dt.Rows[n]["F_CREATE_TIME"].ToString() != "")
                        {
                            model.F_CREATE_TIME = DateTime.Parse(dt.Rows[n]["F_CREATE_TIME"].ToString());
                        }
                        model.F_OPERATOR_ID = dt.Rows[n]["F_OPERATOR_ID"].ToString();
                        if (dt.Rows[n]["F_OPERATIONTIME"].ToString() != "")
                        {
                            model.F_OPERATIONTIME = DateTime.Parse(dt.Rows[n]["F_OPERATIONTIME"].ToString());
                        }
                        if (dt.Rows[n]["F_DEL"].ToString() != "")
                        {
                            model.F_DEL = decimal.Parse(dt.Rows[n]["F_DEL"].ToString());
                        }


                        modelList.Add(model);
                    }
                }
                return(modelList);
            }
            catch (Exception ex)
            {
                Log.Error("BllTEST_ALLOCATION->DataTableToList---FAILED", ex);
                throw ex;
            }
            finally
            {
                ConnectionClose();
                Log.Info("BllTEST_ALLOCATION->DataTableToList---finally");
            }
        }