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);
     }
 }
 /// <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));
 }
 /// <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));
 }
 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;
 }
 /// <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;
 }
 /// <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));
 }
 /// <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;
 }