public static bool Update(SE_GroupBuyingConfig model)
 {
     using (var connection = ProcessConnection.OpenConfiguration)
     {
         return(DALSE_GroupBuying.Update(connection, model));
     }
 }
Example #2
0
        public static bool Add(SqlConnection connection, SE_GroupBuyingConfig model)
        {
            string sql = @"INSERT INTO Configuration.dbo.SE_GroupBuyingConfig
                            (
                              PID ,
                              FalshSaleGuid ,
                              ActivityPrice ,
                              LimitSaleNumber ,
                              LimitGroupNumber ,
                              IsGroupBuy ,
                              OrderBy ,
                              CreateDate ,
                              UpdateDate
                            )
                    VALUES  ( 
                              @PID , -- PID - varchar(50)
                              @FalshSaleGuid , -- FalshSaleGuid - uniqueidentifier
                              @ActivityPrice , -- ActivityPrice - money
                              @LimitSaleNumber , -- LimitSaleNumber - int
                              @LimitGroupNumber , -- LimitGroupNumber - int
                              @IsGroupBuy , -- IsGroupBuy - bit
                              @OrderBy , -- OrderBy - int
                              GETDATE() , -- CreateDate - datetime
                              GETDATE()  -- UpdateDate - datetime
                            )";

            return(connection.Execute(sql, model) > 0);
        }
Example #3
0
        public static bool Update(SqlConnection connection, SE_GroupBuyingConfig model)
        {
            string sql = @"UPDATE Configuration.dbo.SE_GroupBuyingConfig SET PID=@PID,FalshSaleGuid=@FalshSaleGuid,ActivityPrice=@ActivityPrice,
		LimitSaleNumber=@LimitSaleNumber,LimitGroupNumber=@LimitGroupNumber,IsGroupBuy=@IsGroupBuy,OrderBy=@OrderBy,UpdateDate=GETDATE()
		WHERE ID=@ID "        ;

            return(connection.Execute(sql, model) > 0);
        }
Example #4
0
 public ActionResult Save(SE_GroupBuyingConfig model)
 {
     if (model.ID == 0)
     {
         if (SE_GroupBuyingManager.Add(model))
         {
             return(Json(1));
         }
         else
         {
             return(Json(0));
         }
     }
     else
     if (SE_GroupBuyingManager.Update(model))
     {
         return(Json(1));
     }
     else
     {
         return(Json(0));
     }
 }