Ejemplo n.º 1
0
        /// <summary>
        /// 添加考核心标准维护表
        /// </summary>
        /// <param name="error"></param>
        /// <returns></returns>
        public static bool AddPerformanceReviewStandardManager(Model.PerformanceReviewStandard performancereviewstandard, ref string error)
        {
            if (IsExit(performancereviewstandard.StandardName, performancereviewstandard.PerformanceReviewItem))
            {
                error = "已存在的标准考核名称或考核项目,请重新填写!";
                return false;
            }

            if (string.IsNullOrEmpty(performancereviewstandard.StandardName) || string.IsNullOrEmpty(performancereviewstandard.PerformanceReviewItem)
                || string.IsNullOrEmpty(performancereviewstandard.Description) || string.IsNullOrEmpty(performancereviewstandard.FullScore.ToString())
                || string.IsNullOrEmpty(performancereviewstandard.StatMode.ToString()) || string.IsNullOrEmpty(performancereviewstandard.RowNumber.ToString()))
            {
                error = "核心标准维护信息不完整!";
                return false;
            }
            string sql = string.Format(@" insert into PerformanceReviewStandard (StandardName,PerformanceReviewItem,RowNumber,FullScore,Description,StatMode,Remark,Type) values
               ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')", performancereviewstandard.StandardName,
               performancereviewstandard.PerformanceReviewItem, performancereviewstandard.RowNumber, performancereviewstandard.FullScore, performancereviewstandard.Description, performancereviewstandard.StatMode,
            performancereviewstandard.Remark, performancereviewstandard.Type);
            return SqlHelper.ExecuteSql(sql, ref error);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改考核心标准维护表
        /// </summary>
        /// <param name="error"></param>
        /// <returns></returns>
        public static bool EditPerformanceReviewStandardManager(Model.PerformanceReviewStandard performancereviewstandard, ref string error, string StandardName, string PerformanceReviewItem)
        {
            //if (IsExit(performancereviewstandard.StandardName, performancereviewstandard.PerformanceReviewItem))
            //{
            //    error = "已存在的标准考核名称或考核项目,请重新填写!";
            //    return false;
            //}

            if (string.IsNullOrEmpty(performancereviewstandard.StandardName) || string.IsNullOrEmpty(performancereviewstandard.PerformanceReviewItem)
                || string.IsNullOrEmpty(performancereviewstandard.Description) || string.IsNullOrEmpty(performancereviewstandard.FullScore.ToString())
                || string.IsNullOrEmpty(performancereviewstandard.StatMode.ToString()) || string.IsNullOrEmpty(performancereviewstandard.RowNumber.ToString()))
            {
                error = "核心标准维护信息不完整!";
                return false;
            }
            string sql = string.Format(@" update PerformanceReviewStandard
            set RowNumber={0},FullScore={1},Description='{2}',StatMode={3},Remark='{4}',Type='{7}'
            where StandardName='{5}' and  PerformanceReviewItem='{6}'",
               performancereviewstandard.RowNumber, performancereviewstandard.FullScore, performancereviewstandard.Description, performancereviewstandard.StatMode,
            performancereviewstandard.Remark, StandardName, PerformanceReviewItem,
            performancereviewstandard.Type);
            return SqlHelper.ExecuteSql(sql, ref error);
        }