public ActionResult GetCouponValidate(Guid?guid, string startDateTime, string endDateTime) { if (!guid.HasValue) { return(Json(null)); } else { PromotionActivityManager manager = new PromotionActivityManager(); SE_GetPromotionActivityCouponInfoConfig model = manager.GetCouponValidate(guid.Value); if (model != null) { SE_CarTagCouponConfig config = new SE_CarTagCouponConfig() { CouponGuid = guid.ToString(), CreateDate = DateTime.Now, Description = model.Description, Discount = model.Discount, // EndDateTime =Convert.ToDateTime(endDateTime??DateTime.Now.ToString()), MinMoney = model.MinMoney, // StartDateTime= Convert.ToDateTime(startDateTime??DateTime.Now.AddMonths(1).ToString()), Status = true }; if (new CarTagManager().Add(config)) { return(Json(config)); } else { return(Json(null)); } } return(Json(null)); } }
public bool Add(SE_CarTagCouponConfig model) { string sql = @"INSERT INTO Configuration.dbo.SE_CarTagCouponConfig ( CouponGuid , Discount , Description , MinMoney , Status , CreateDate ) VALUES ( @CouponGuid , -- CouponGuid - nvarchar(50) @Discount , -- Discount - money @Description , -- Description - nvarchar(50) @MinMoney , -- MinMoney - money @Status , -- Status - bit @CreateDate -- CreateDate - datetime )"; return(DbHelper.ExecuteNonQuery(sql, CommandType.Text, new SqlParameter[] { new SqlParameter("@CouponGuid", model.CouponGuid), new SqlParameter() { ParameterName = "@Discount", Value = model.Discount }, new SqlParameter() { ParameterName = "@Description", Value = model.Description }, new SqlParameter() { ParameterName = "@MinMoney", Value = model.MinMoney }, new SqlParameter() { ParameterName = "@Status", Value = 1 }, new SqlParameter() { ParameterName = "@CreateDate", Value = DateTime.Now } // new SqlParameter() { ParameterName="@StartDateTime",Value=model.StartDateTime}, // new SqlParameter() { ParameterName="@EndDateTime" ,Value=model.EndDateTime} }) > 0); }
public bool Add(SE_CarTagCouponConfig model) { return(new DALCarTag().Add(model)); }