Ejemplo n.º 1
0
        /// <summary>
        /// 删除日常管理考核得分数据
        /// </summary>
        /// <param name="ManagementScore">日常管理考核得分实体</param>
        /// <returns>删除的数据行数</returns>
        public int DeleteManagementScore(ManagementScoreEntity ManagementScore)
        {
            string SqlText = @"DELETE FROM KPI_ManagementScore WHERE PersonID=@PersonID AND 
                               CheckDate=@CheckDate AND TagID=@TagID ";

            return(m_DataAccess.ExecuteNonQuery(CommandType.Text, SqlText, GetParameters(ManagementScore)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新日常管理考核得分数据
        /// </summary>
        /// <param name="ManagementScore">日常管理考核得分实体</param>
        /// <returns>更新的数据行数</returns>
        private int UpdateManagementScore(ManagementScoreEntity ManagementScore)
        {
            string SqlText = @"Update KPI_ManagementScore Set Shift=@Shift, Score=@Score,  
                               IsValid=@IsValid,TagScore=@TagScor , Rate=@Rate 
                               Where PersonID = @PersonID and CheckDate = @CheckDate and TagID = @TagID ";

            return(m_DataAccess.ExecuteNonQuery(CommandType.Text, SqlText, GetParameters(ManagementScore)));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 新增日常管理考核得分数据
        /// </summary>
        /// <param name="ManagementScore">日常管理考核得分实体</param>
        /// <returns>新增的数据行数</returns>
        private int AddManagementScore(ManagementScoreEntity ManagementScore)
        {
            string SqlText = @"Insert KPI_ManagementScore (PersonID,CheckDate,Shift,TagID,Score,IsValid,
                               TagScore,Rate) Values (@PersonID,@CheckDate,@Shift,@TagID,@Score,@IsValid,
                               @TagScore,@Rate) ";

            return(m_DataAccess.ExecuteNonQuery(CommandType.Text, SqlText, GetParameters(ManagementScore)));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 保存日常管理考核得分数据
        /// </summary>
        /// <param name="ManagementScore">日常管理考核得分实体</param>
        /// <returns>成功保存的行数</returns>
        public int SaveManagementScore(ManagementScoreEntity ManagementScore)
        {
            int Result = 0;

            if (Exists(ManagementScore))
            {
                Result = UpdateManagementScore(ManagementScore);
            }
            else
            {
                Result = AddManagementScore(ManagementScore);
            }
            return(Result);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取日常管理考核得分数据
        /// </summary>
        /// <param name="PersonID">个人编码</param>
        /// <param name="CheckDate">考核日期</param>
        /// <param name="TagID">指标编码</param>
        /// <returns>日常管理考核得分实体</returns>
        public ManagementScoreEntity GetManagementScore(string PersonID, DateTime CheckDate, string TagID)
        {
            string SqlText = @"SELECT * FROM  KPI_ManagementScore WHERE PersonID=@PersonID AND 
                                CheckDate=@CheckDate AND TagID=@TagID ";

            IDbDataParameter[] Parameters = new SqlParameter[] {
                new SqlParameter("@PersonID", SqlDbType.VarChar),
                new SqlParameter("@CheckDate", SqlDbType.Date),
                new SqlParameter("@TagID", SqlDbType.VarChar)
            };
            Parameters[0].Value = PersonID;
            Parameters[1].Value = CheckDate;
            Parameters[2].Value = TagID;
            ManagementScoreEntity Result = null;

            using (IDataReader DataReader = m_DataAccess.ExecuteReader(CommandType.Text, SqlText, Parameters)) {
                Result = DataReader.FillEntity <ManagementScoreEntity>();
            };
            return(Result);
        }
Ejemplo n.º 6
0
        public void RaiseCallbackEvent(string eventArgument)
        {
            String Action   = eventArgument.Split(',')[0].Split('=')[1];
            String Argument = eventArgument.Split(',')[1].Split('=')[1];

            if (Action == "InputTags")
            {
                KPI_InputTagDal       InputTagDataAccess = new KPI_InputTagDal();
                List <InputTagEntity> InputTags          = InputTagDataAccess.GetInputTags(Argument);
                var Result = new {
                    Action = Action,
                    data   = InputTags.Select(p => new {
                        InputID   = p.InputID,
                        InputDesc = p.InputDesc
                    }).ToList()
                };
                m_CallbackResult = JsonConvert.SerializeObject(Result);
            }
            if (Action == "InitialPerson")
            {
                List <ManagementScoreEntity> List = new List <ManagementScoreEntity>();
                ManagementScoreEntity        Entity;
                for (int i = 0; i < 10; i++)
                {
                    Entity = new ManagementScoreEntity {
                        Rate         = 80.0m,
                        Shift        = 1,
                        PersonName   = "韩娜",
                        PositionName = "值长"
                    };
                    List.Add(Entity);
                }
                var Result = new {
                    Action = Action,
                    data   = List
                };
                m_CallbackResult = JsonConvert.SerializeObject(Result);
            }
        }
Ejemplo n.º 7
0
 private IDbDataParameter[] GetParameters(ManagementScoreEntity ManagementScore)
 {
     IDbDataParameter[] Parameters = new SqlParameter[] {
         new SqlParameter("@PersonID", SqlDbType.VarChar),
         new SqlParameter("@CheckDate", SqlDbType.Date),
         new SqlParameter("@Shift", SqlDbType.Int),
         new SqlParameter("@TagID", SqlDbType.VarChar),
         new SqlParameter("@Score", SqlDbType.Decimal),
         new SqlParameter("@IsValid", SqlDbType.Bit),
         new SqlParameter("@TagScore", SqlDbType.Decimal),
         new SqlParameter("@Rate", SqlDbType.Decimal)
     };
     Parameters[0].Value = ManagementScore.PersonID;
     Parameters[1].Value = ManagementScore.CheckDate;
     Parameters[2].Value = ManagementScore.Shift;
     Parameters[3].Value = ManagementScore.TagID;
     Parameters[4].Value = ManagementScore.Score;
     Parameters[5].Value = ManagementScore.IsValid;
     Parameters[6].Value = ManagementScore.TagScore;
     Parameters[7].Value = ManagementScore.Rate;
     return(Parameters);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 判断日常管理考核得分数据是否存在
        /// </summary>
        /// <param name="ManagementScore">日常管理考核得分实体</param>
        /// <returns>数据存在则返回true否则返回false</returns>
        private bool Exists(ManagementScoreEntity ManagementScore)
        {
            string SqlText = @"SELECT COUNT(PersonID) FROM  KPI_ManagementScore WHERE PersonID=@PersonID AND CheckDate=@CheckDate AND TagID=@TagID ";

            return((int)m_DataAccess.ExecuteScalar(SqlText, GetParameters(ManagementScore)) > 0);
        }