Exemple #1
0
        /// <summary>
        /// 更新酒水进货记录
        /// </summary>
        /// <param name="dp"></param>
        /// <returns></returns>
        public static bool UpdateDrinksPO(DrinksPO dp)
        {
            string cmdline = @"UPDATE [dbo].[DrinksPO]
                                   SET [Amount] = @amount
                                      ,[VendorId] = @vendorid
                                      ,[OwnerId] = @ownerid
                                      ,[AddDate] = @adddate
                                      ,[WeekDay] = @weekday
                                      ,[Comments] = @comments
                                      ,[LastUpdateTime] = @lastupdatetime
                                 WHERE [Id] = @id";

            SqlParameter[] parameters =
            {
                new SqlParameter("@amount",         dp.Amount),
                new SqlParameter("@vendorid",       dp.VendorId),
                new SqlParameter("@ownerid",        dp.OwnerId),
                new SqlParameter("@adddate",        dp.AddDate),
                new SqlParameter("@weekday",        DateTime.Parse(dp.AddDate).DayOfWeek),
                new SqlParameter("@comments",       dp.Comments),
                new SqlParameter("@lastupdatetime", DateTime.Now),
                new SqlParameter("@id",             dp.Id)
            };
            return(SqlHelper.ExecuteNonQuery(cmdline, parameters));
        }
Exemple #2
0
        /// <summary>
        /// 添加酒水进货记录
        /// </summary>
        /// <param name="dp"></param>
        /// <returns></returns>
        public static bool AddDrinksPO(DrinksPO dp)
        {
            string cmdline = @"INSERT INTO [dbo].[DrinksPO]
                                       ([Amount]
                                       ,[VendorId]
                                       ,[OwnerId]
                                       ,[AddDate]
                                       ,[WeekDay]
                                       ,[Comments]
                                       ,[CreateTime]
                                       ,[LastUpdateTime])
                                 VALUES
                                       (@amount, @vendorid, @ownerid, @adddate, @weekday, @comments, @createtime, @lastupdatetime)";

            SqlParameter[] parameters =
            {
                new SqlParameter("@amount",         dp.Amount),
                new SqlParameter("@vendorid",       dp.VendorId),
                new SqlParameter("@ownerid",        dp.OwnerId),
                new SqlParameter("@adddate",        dp.AddDate),
                new SqlParameter("@weekday",        DateTime.Parse(dp.AddDate).DayOfWeek),
                new SqlParameter("@comments",       dp.Comments),
                new SqlParameter("@createtime",     dp.CreateTime),
                new SqlParameter("@lastupdatetime", dp.LastUpdateTime)
            };
            return(SqlHelper.ExecuteNonQuery(cmdline, parameters));
        }
 public bool UpdateDrinksPO([FromBody] DrinksPO po)
 {
     return(DrinksPOHandler.UpdateDrinksPO(po));
 }
 public bool AddDrinksPO([FromBody] DrinksPO po)
 {
     return(DrinksPOHandler.AddDrinksPO(po));
 }