Exemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(RelayTest.Model.ModelTEST_PAR_VALUE_KHD model)
 {
     try
     {
         Log.Info("BllTEST_PAR_VALUE_KHD->Add---START");
         ConnectionOpen();
         dal.SetDBAccess(GetDBAccess());
         dal.Add(model);
     }
     catch (Exception ex)
     {
         Log.Error("BllTEST_PAR_VALUE_KHD->Add---FAILED", ex);
         throw ex;
     }
     finally
     {
         ConnectionClose();
         Log.Info("BllTEST_PAR_VALUE_KHD->Add---finally");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model">相应的数据实体</param>
 /// <returns>真表示有记录被更新,否表示没有记录被更新</returns>
 public bool Update(RelayTest.Model.ModelTEST_PAR_VALUE_KHD model)
 {
     try
     {
         Log.Info("BllTEST_PAR_VALUE_KHD->Update---START");
         ConnectionOpen();
         dal.SetDBAccess(GetDBAccess());
         return(dal.Update(model));
     }
     catch (Exception ex)
     {
         Log.Error("BllTEST_PAR_VALUE_KHD->Update---FAILED", ex);
         throw ex;
     }
     finally
     {
         ConnectionClose();
         Log.Info("BllTEST_PAR_VALUE_KHD->Update---finally");
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <RelayTest.Model.ModelTEST_PAR_VALUE_KHD> DataTableToList(DataTable dt)
        {
            try
            {
                Log.Info("BllTEST_PAR_VALUE_KHD->DataTableToList---START");
                ConnectionOpen();
                dal.SetDBAccess(GetDBAccess());
                List <RelayTest.Model.ModelTEST_PAR_VALUE_KHD> modelList = new List <RelayTest.Model.ModelTEST_PAR_VALUE_KHD>();
                int rowsCount = dt.Rows.Count;
                if (rowsCount > 0)
                {
                    RelayTest.Model.ModelTEST_PAR_VALUE_KHD model;
                    for (int n = 0; n < rowsCount; n++)
                    {
                        model = new RelayTest.Model.ModelTEST_PAR_VALUE_KHD();

                        //试验任务编号
                        model.F_TASK_ID = dt.Rows[n]["F_TASK_ID"].ToString();

                        //程序代码
                        model.F_PROGRAM_CODE = dt.Rows[n]["F_PROGRAM_CODE"].ToString();

                        //参数名称
                        model.F_SENDPAR_NAME = dt.Rows[n]["F_SENDPAR_NAME"].ToString();

                        //参数值
                        model.F_SENDPAR_VALUE = dt.Rows[n]["F_SENDPAR_VALUE"].ToString();

                        //排序序号
                        if (dt.Rows[n]["F_SENDORDER"].ToString() != "")
                        {
                            model.F_SENDORDER = decimal.Parse(dt.Rows[n]["F_SENDORDER"].ToString());
                        }

                        //备注
                        model.F_SENDPAR_MEMO = dt.Rows[n]["F_SENDPAR_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_PAR_VALUE_KHD->DataTableToList---FAILED", ex);
                throw ex;
            }
            finally
            {
                ConnectionClose();
                Log.Info("BllTEST_PAR_VALUE_KHD->DataTableToList---finally");
            }
        }