/// <summary>
        /// 编辑培训考核信息
        /// </summary>
        /// <param name="model">考聘信息</param>
        /// <returns></returns>
        public static bool SaveTrainingAsseInfo(TrainingAsseModel model)
        {
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //设置公司代码
            model.CompanyCD = userInfo.CompanyCD;
            model.ModifiedUserID = userInfo.UserID;
            //定义返回变量
            bool isSucc = false;
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.AsseNo);

            //更新
            if (ConstUtil.EDIT_FLAG_UPDATE.Equals(model.EditFlag))
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_UPDATE;
                    //执行更新操作
                    isSucc = TrainingAsseDBHelper.UpdateTrainingAsseInfo(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //插入
            else
            {
                try
                {
                    logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
                    //执行插入操作
                    isSucc = TrainingAsseDBHelper.InsertTrainingAsseInfo(model);
                }
                catch (Exception ex)
                {
                    //输出系统日志
                    WriteSystemLog(userInfo, ex);
                }
            }
            //更新成功时
            if (isSucc)
            {
                //设置操作成功标识
                logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            //更新不成功
            else
            {
                //设置操作成功标识 
                logModel.Remark = ConstUtil.LOG_PROCESS_FAILED;
            }

            //登陆日志
            LogDBHelper.InsertLog(logModel);

            return isSucc;
        }
        /// <summary>
        /// 添加培训考核信息
        /// </summary>
        /// <param name="model">培训考核信息</param>
        /// <returns></returns>
        public static bool InsertTrainingAsseInfo(TrainingAsseModel model)
        {

            #region 插入SQL拼写
            StringBuilder insertSql = new StringBuilder();
            insertSql.AppendLine(" INSERT INTO officedba.TrainingAsse ");
            insertSql.AppendLine("            (CompanyCD              ");
            insertSql.AppendLine("            ,AsseNo                 ");
            insertSql.AppendLine("            ,TrainingNo             ");
            insertSql.AppendLine("            ,CheckPerson            ");
            insertSql.AppendLine("            ,TrainingPlan           ");
            insertSql.AppendLine("            ,FillUser               ");
            insertSql.AppendLine("            ,LeadViews              ");
            insertSql.AppendLine("            ,Description            ");
            insertSql.AppendLine("            ,CheckWay               ");
            insertSql.AppendLine("            ,CheckDate              ");
            insertSql.AppendLine("            ,GeneralComment         ");
            insertSql.AppendLine("            ,CheckRemark            ");
            insertSql.AppendLine("            ,ModifiedDate           ");
            insertSql.AppendLine("            ,ModifiedUserID)        ");
            insertSql.AppendLine(" VALUES                             ");
            insertSql.AppendLine("            (@CompanyCD             ");
            insertSql.AppendLine("            ,@AsseNo                ");
            insertSql.AppendLine("            ,@TrainingNo            ");
            insertSql.AppendLine("            ,@CheckPerson           ");
            insertSql.AppendLine("            ,@TrainingPlan          ");
            insertSql.AppendLine("            ,@FillUser              ");
            insertSql.AppendLine("            ,@LeadViews             ");
            insertSql.AppendLine("            ,@Description           ");
            insertSql.AppendLine("            ,@CheckWay              ");
            insertSql.AppendLine("            ,@CheckDate             ");
            insertSql.AppendLine("            ,@GeneralComment        ");
            insertSql.AppendLine("            ,@CheckRemark           ");
            insertSql.AppendLine("            ,getdate()              ");
            insertSql.AppendLine("            ,@ModifiedUserID)       ");
            #endregion

            //定义更新基本信息的命令
            SqlCommand comm = new SqlCommand();
            comm.CommandText = insertSql.ToString();
            //设置保存的参数
            SetSaveParameter(comm, model);
            //定义更新列表
            ArrayList lstInsert = new ArrayList();
            //添加基本信息更新命令
            lstInsert.Add(comm);
            //考核结果
            EditResultInfo(lstInsert, model.ResultList, model.AsseNo, model.CompanyCD, model.ModifiedUserID);

            //执行更新操作并返回更新结果
            return SqlHelper.ExecuteTransWithArrayList(lstInsert);

        }
        /// <summary>
        /// 更新考核信息
        /// </summary>
        /// <param name="model">考核信息</param>
        /// <returns></returns>
        public static bool UpdateTrainingAsseInfo(TrainingAsseModel model)
        {

            #region 更新SQL拼写
            StringBuilder updateSql = new StringBuilder();
            updateSql.AppendLine(" UPDATE officedba.TrainingAsse      ");
            updateSql.AppendLine(" SET                                ");
            updateSql.AppendLine(" 	 TrainingNo = @TrainingNo         ");
            updateSql.AppendLine(" 	,CheckPerson = @CheckPerson       ");
            updateSql.AppendLine(" 	,TrainingPlan = @TrainingPlan     ");
            updateSql.AppendLine(" 	,LeadViews = @LeadViews           ");
            updateSql.AppendLine(" 	,Description = @Description       ");
            updateSql.AppendLine(" 	,CheckWay = @CheckWay             ");
            updateSql.AppendLine(" 	,CheckDate = @CheckDate           ");
            updateSql.AppendLine(" 	,GeneralComment = @GeneralComment ");
            updateSql.AppendLine(" 	,CheckRemark = @CheckRemark       ");
            updateSql.AppendLine(" 	,ModifiedDate = getdate()         ");
            updateSql.AppendLine(" 	,ModifiedUserID = @ModifiedUserID ");
            updateSql.AppendLine("  WHERE                             ");
            updateSql.AppendLine(" 	CompanyCD = @CompanyCD            ");
            updateSql.AppendLine(" 	AND AsseNo = @AsseNo              ");
            #endregion

            //定义更新基本信息的命令
            SqlCommand comm = new SqlCommand();
            comm.CommandText = updateSql.ToString();
            //设置保存的参数
            SetSaveParameter(comm, model);
            //定义更新列表
            ArrayList lstUpdate = new ArrayList();
            //添加基本信息更新命令
            lstUpdate.Add(comm);
            //登陆或者更新进度安排信息
            EditResultInfo(lstUpdate, model.ResultList, model.AsseNo, model.CompanyCD, model.ModifiedUserID);

            //执行更新操作并返回更新结果
            return SqlHelper.ExecuteTransWithArrayList(lstUpdate);
        }
 /// <summary>
 /// 保存时基本信息参数设置
 /// </summary>
 /// <param name="comm">命令</param>
 /// <param name="model">人员信息</param>
 private static void SetSaveParameter(SqlCommand comm, TrainingAsseModel model)
 {
     //设置参数
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", model.CompanyCD));//公司代码
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@AsseNo", model.AsseNo));//考核编号
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@TrainingNo", model.TrainingNo));//培训编号(对应培训表中的培训编号)
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@CheckPerson", model.CheckPerson));//考核人
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@TrainingPlan", model.TrainingPlan));//培训规划
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@LeadViews", model.LeadViews));//领导意见
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@Description", model.Description));//说明
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@CheckWay", model.CheckWay));//考核方式
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@CheckDate", model.CheckDate));//考核时间
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@GeneralComment", model.GeneralComment));//考核总评
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@CheckRemark", model.CheckRemark));//考核备注
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@ModifiedUserID", model.ModifiedUserID));//更新用户ID
     //插入时,添加填写人参数
     if (ConstUtil.EDIT_FLAG_INSERT == model.EditFlag)
     {
         comm.Parameters.Add(SqlHelper.GetParameterFromString("@FillUser", model.FillUser));//填写人
     }
 }