public int AnimationSave(HomePagePopupAnimation model) { if (model.MovementType == -1) { return(0); } else { HomePageConfigManager config = new HomePageConfigManager(); if (string.IsNullOrWhiteSpace(model.Creator)) { model.Creator = HttpContext.User.Identity.Name; } var addedId = config.AnimationSave(model); if (addedId > 0) { var oprLog = new OprLog { ObjectID = model.PopupConfigId, ObjectType = "HPPopup", AfterValue = "新建的弹窗动画配置的pkid:" + addedId + ", 图片链接:" + model.ImageUrl + ", 动作类型:" + model.MovementType + ", 跳转链接:" + model.LinkUrl, Author = HttpContext.User.Identity.Name, Operation = "新建弹窗动画" }; new OprLogManager().AddOprLog(oprLog); } return(addedId); } }
public bool AnimationUpdate(HomePagePopupAnimation model) { HomePageConfigManager config = new HomePageConfigManager(); var hasUpdateSucceeded = config.AnimationUpdate(model); if (hasUpdateSucceeded) { var oprLog = new OprLog { ObjectID = model.PopupConfigId, ObjectType = "HPPopup", AfterValue = "更新的弹窗动画配置的pkid:" + model.PKId + ", 图片链接:" + model.ImageUrl + ", 动作类型:" + model.MovementType + ", 跳转链接:" + model.LinkUrl, Author = HttpContext.User.Identity.Name, Operation = "更新弹窗动画" }; new OprLogManager().AddOprLog(oprLog); } return(hasUpdateSucceeded); }
/// <summary> /// 保存动画 /// </summary> /// <param name="sqlconnection"></param> /// <param name="model"></param> /// <returns></returns> public static int AnimationSave(SqlConnection sqlconnection, HomePagePopupAnimation model) { string sql = @"insert into Configuration..[HomePagePopupAnimationConfig](PopupConfigId,ImageUrl,MovementType,ImageWidth,ImageHeight,LeftMargin,TopMargin,ZIndex,LinkUrl,CreateDateTime,UpdateDateTime,Creator,MiniGramId,MGPageUrl) values(@PopupConfigId,@ImageUrl,@MovementType,@ImageWidth,@ImageHeight,@LeftMargin,@TopMargin,@ZIndex,@LinkUrl,GETDATE(),GETDATE(),@Creator,@MiniGramId,@MGPageUrl);Select SCOPE_IDENTITY();"; var sqlpara = new SqlParameter[] { new SqlParameter("@PopupConfigId", model.PopupConfigId), new SqlParameter("@ImageUrl", model.ImageUrl), new SqlParameter("@MovementType", model.MovementType), new SqlParameter("@ImageWidth", model.ImageWidth), new SqlParameter("@ImageHeight", model.ImageHeight), new SqlParameter("@LeftMargin", model.LeftMargin), new SqlParameter("@TopMargin", model.TopMargin), new SqlParameter("@LinkUrl", (string.IsNullOrWhiteSpace(model.LinkUrl) || string.Equals(model.LinkUrl, "null", StringComparison.InvariantCultureIgnoreCase))? null : model.LinkUrl), new SqlParameter("@ZIndex", model.ZIndex), new SqlParameter("@Creator", model.Creator), new SqlParameter("@MiniGramId", (string.IsNullOrWhiteSpace(model.MiniGramId) || string.Equals(model.MiniGramId, "null", StringComparison.InvariantCultureIgnoreCase))? null : model.MiniGramId), new SqlParameter("@MGPageUrl", (string.IsNullOrWhiteSpace(model.MGPageUrl) || string.Equals(model.MGPageUrl, "null", StringComparison.InvariantCultureIgnoreCase)) ? null : model.MGPageUrl) }; int result = int.Parse(SqlHelper.ExecuteScalar(sqlconnection, CommandType.Text, sql, sqlpara).ToString()); return(result); }
public bool AnimationUpdate(HomePagePopupAnimation model) { return(handler.AnimationUpdate(model)); }
public int AnimationSave(HomePagePopupAnimation model) { return(handler.AnimationSave(model)); }
/// <summary> /// 更换图片 /// </summary> public bool AnimationUpdate(HomePagePopupAnimation model) { Func <SqlConnection, bool> action = (connection) => DalHomePageConfig.AnimationUpdate(connection, model); return(dbManager.Execute(action)); }
/// <summary> /// 动画保存 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AnimationSave(HomePagePopupAnimation model) { Func <SqlConnection, int> action = (connection) => DalHomePageConfig.AnimationSave(connection, model); return(dbManager.Execute(action)); }