Ejemplo n.º 1
0
        /// <summary>
        /// 添加员工绩效上报表
        /// </summary>
        /// <param name="error"></param>
        /// <returns></returns>
        public static bool AddPerformanceReviewLogManager(Model.PerformanceReviewLog performancereviewlog, ref string error)
        {
            if (IsExit(performancereviewlog.Year, performancereviewlog.Month, performancereviewlog.PerformanceReviewItem, performancereviewlog.Name))
            {
                error = "已存在的员工绩效信息,请重新填写!";
                return(false);
            }

            if (string.IsNullOrEmpty(performancereviewlog.Year) || string.IsNullOrEmpty(performancereviewlog.Month) ||
                string.IsNullOrEmpty(performancereviewlog.PerformanceReviewItem) ||
                string.IsNullOrEmpty(performancereviewlog.RowNumber.ToString()) || string.IsNullOrEmpty(performancereviewlog.FullScore.ToString()) ||
                string.IsNullOrEmpty(performancereviewlog.Deduction.ToString()) || string.IsNullOrEmpty(performancereviewlog.Score.ToString()) ||
                string.IsNullOrEmpty(performancereviewlog.Description) || string.IsNullOrEmpty(performancereviewlog.StatMode.ToString()) ||
                string.IsNullOrEmpty(performancereviewlog.Name.ToString()))
            {
                error = "员工绩效信息不完整!";
                return(false);
            }
            string sql = string.Format(@" insert into PerformanceReviewLog (Year,Month,PerformanceReviewItem,RowNumber,FullScore,Deduction,Score,Description,StatMode,Remark,Name) values 
           ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", performancereviewlog.Year,
                                       performancereviewlog.Month, performancereviewlog.PerformanceReviewItem, performancereviewlog.RowNumber, performancereviewlog.FullScore, performancereviewlog.Deduction,
                                       performancereviewlog.Score, performancereviewlog.Description, performancereviewlog.StatMode, performancereviewlog.Remark, performancereviewlog.Name);

            return(SqlHelper.ExecuteSql(sql, ref error));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改考员工绩效上报表
        /// </summary>
        /// <param name="error"></param>
        /// <returns></returns>
        public static bool EditPerformanceReviewLogManager(Model.PerformanceReviewLog performancereviewlog, ref string error, string Year, string Month, string PerformanceReviewItem, string Name)
        {
            if (string.IsNullOrEmpty(performancereviewlog.Year) || string.IsNullOrEmpty(performancereviewlog.Month) ||
                string.IsNullOrEmpty(performancereviewlog.PerformanceReviewItem) ||
                string.IsNullOrEmpty(performancereviewlog.RowNumber.ToString()) || string.IsNullOrEmpty(performancereviewlog.FullScore.ToString()) ||
                string.IsNullOrEmpty(performancereviewlog.Deduction.ToString()) || string.IsNullOrEmpty(performancereviewlog.Score.ToString()) ||
                string.IsNullOrEmpty(performancereviewlog.Name.ToString()))
            {
                error = "员工绩效信息不完整!";
                return(false);
            }
            string sql = string.Format(@" update PerformanceReviewLog set RowNumber={0},FullScore={1},Deduction={2},Score={3},Description='{4}',StatMode='{5}',Remark='{6}'  where Year='{7}' and Month='{8}' and PerformanceReviewItem='{9}' and Name='{10}'",
                                       performancereviewlog.RowNumber, performancereviewlog.FullScore, performancereviewlog.Deduction,
                                       performancereviewlog.Score, performancereviewlog.Description, performancereviewlog.StatMode, performancereviewlog.Remark, Year, Month, PerformanceReviewItem, performancereviewlog.Name);

            return(SqlHelper.ExecuteSql(sql, ref error));
        }