/// <summary>
        /// 更新计件工资项信息
        /// </summary>
        /// <param name="model">计件工资项信息</param>
        /// <returns></returns>
        private static SqlCommand UpdatePieceworkSalaryInfo(PieceworkSalaryModel model)
        {

            #region SQL文拼写
            StringBuilder updateSql = new StringBuilder();
            updateSql.AppendLine(" UPDATE officedba.PieceworkSalary      ");
            updateSql.AppendLine(" SET  Amount = @Amount                 ");
            updateSql.AppendLine(" 	,SalaryMoney = @SalaryMoney          ");
            updateSql.AppendLine(" 	,ModifiedDate = getdate()            ");
            updateSql.AppendLine(" 	,ModifiedUserID = @ModifiedUserID    ");
            updateSql.AppendLine(" WHERE                                 ");
            updateSql.AppendLine(" 	CompanyCD = @CompanyCD               ");  
            updateSql.AppendLine(" 	AND ItemNo = @ItemNo                 ");
            updateSql.AppendLine(" 	AND EmployeeID = @EmployeeID         ");
            updateSql.AppendLine(" 	AND CONVERT(VARCHAR(10),PieceDate,21)");
            updateSql.AppendLine(" 	 = CONVERT(VARCHAR(10),@PieceDate,21)");
          
            #endregion

            //定义更新基本信息的命令  
            SqlCommand comm = new SqlCommand();
            comm.CommandText = updateSql.ToString();
            //参数
            SetSaveParameter(comm, model);
            //执行更新
            return comm;
        }
 /// <summary>
 /// 保存时参数设置
 /// </summary>
 /// <param name="comm">命令</param>
 /// <param name="model">人才代理信息</param>
 private static void SetSaveParameter(SqlCommand comm, PieceworkSalaryModel model)
 {
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", model.CompanyCD));//公司代码
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@EmployeeID", model.EmployeeID));//员工ID
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@ItemNo", model.ItemNo));//计件工资项编号
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@PieceDate", model.PieceDate));//计件工资项日期
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@Amount", model.Amount));//业务量
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@SalaryMoney", model.SalaryMoney));//金额
     comm.Parameters.Add(SqlHelper.GetParameterFromString("@ModifiedUserID", model.ModifiedUserID));//最后修改人
 }
        /// <summary>
        /// 新建计件工资项信息 
        /// </summary>
        /// <param name="model">计件工资项信息</param>
        /// <returns></returns>
        private static SqlCommand InsertPieceworkSalaryInfo(PieceworkSalaryModel model)
        {
            #region 登陆SQL文
            StringBuilder insertSql = new StringBuilder();
            insertSql.AppendLine(" INSERT INTO                ");
            insertSql.AppendLine(" officedba.PieceworkSalary  ");
            insertSql.AppendLine(" 	(CompanyCD                ");
            insertSql.AppendLine(" 	,EmployeeID               ");
            insertSql.AppendLine(" 	,PieceDate                ");
            insertSql.AppendLine(" 	,ItemNo                   ");
            insertSql.AppendLine(" 	,Amount                   ");
            insertSql.AppendLine(" 	,SalaryMoney              ");
            insertSql.AppendLine(" 	,ModifiedDate             ");
            insertSql.AppendLine(" 	,ModifiedUserID)          ");
            insertSql.AppendLine(" VALUES                     ");
            insertSql.AppendLine(" 	(@CompanyCD               ");
            insertSql.AppendLine(" 	,@EmployeeID              ");
            insertSql.AppendLine(" 	,@PieceDate               ");
            insertSql.AppendLine(" 	,@ItemNo                  ");
            insertSql.AppendLine(" 	,@Amount                  ");
            insertSql.AppendLine(" 	,@SalaryMoney             ");
            insertSql.AppendLine(" 	,getdate()                ");
            insertSql.AppendLine(" 	,@ModifiedUserID)         ");
            insertSql.AppendLine(" SET @SalaryID= @@IDENTITY  ");
            #endregion

            //定义更新基本信息的命令
            SqlCommand comm = new SqlCommand();
            //设置存储过程名
            comm.CommandText = insertSql.ToString();
            //设置保存的参数
            SetSaveParameter(comm, model);

            //添加返回参数
            comm.Parameters.Add(SqlHelper.GetOutputParameter("@SalaryID", SqlDbType.Int));

            //执行插入并返回插入结果
            return comm;
        }