Ejemplo n.º 1
0
        /// <summary>
        /// 插入操作
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Insert(UserPlanEntity entity)
        {
            string sql = @"INSERT INTO [UserPlan]
                                   ([UserId]
                                   ,[Importance]
                                   ,[Tag]
                                   ,[Detail]
                                   ,[IsRemind]
                                   ,[PerRemind]
                                   ,[perRemindTime]
                                   ,[HappenTime]
                                   ,[UseTime]
                                   ,[CreateTime]
                                   ,[UpdateTime])
                             VALUES
                                   (@UserId 
                                   ,@IMPORTANCE
                                   ,@Tag
                                   ,@Detail
                                   ,@IsRemind
                                   ,@PerRemind
                                   ,@perRemindTime
                                   ,@HappenTime
                                   ,@UseTime
                                   ,GETDATE()
                                   ,GETDATE())";

            return(Execute(OpenMsSqlConnection(), sql, entity));
        }
Ejemplo n.º 2
0
        public JsonResult Edit(UserPlanEntity entity)
        {
            //entity.UserId = Account.UserId;
            var id     = _upService.Update(entity);
            var result = new { result = id };

            return(Json(result));
        }
Ejemplo n.º 3
0
        public JsonResult Add(UserPlanEntity entity)
        {
            entity.UserId = Account.UserId;
            int id     = _upService.Insert(entity);
            var result = new { result = (id > 0) };

            return(Json(result));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 更新操作
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool Update(UserPlanEntity entity)
        {
            string sql = @"UPDATE [UserPlan]
                               SET [Importance] = @IMPORTANCE
                                  ,[Tag] = @Tag
                                  ,[Detail] = @Detail
                                  ,[IsRemind] = @IsRemind
                                  ,[PerRemind] = @PerRemind
                                  ,[perRemindTime] = @perRemindTime
                                  ,[HappenTime] = @HappenTime
                                  ,[UseTime] = @UseTime
                                  ,[UpdateTime] = GETDATE() 
                             WHERE Id = @Id";

            return(Execute(OpenMsSqlConnection(), sql, entity) > 0);
        }
Ejemplo n.º 5
0
 public bool Update(UserPlanEntity entity)
 {
     return(_repository.Update(entity));
 }
Ejemplo n.º 6
0
 public int Insert(UserPlanEntity entity)
 {
     return(_repository.Insert(entity));
 }