private List <MarketingAction> search() { List <MarketingAction> list = new List <MarketingAction>(); connection = new MySqlConnection(connString); try { connection.Open(); command = new MySqlCommand(sql, connection); dataReader = command.ExecuteReader(); while (dataReader.Read()) { MarketingAction mnga = new MarketingAction(); mnga.BusinessPlanId = dataReader.GetInt32(1); mnga.ID = dataReader.GetInt32(0); mnga.Title = dataReader.GetString(2); mnga.ImplementationCost = dataReader.GetInt32(3); mnga.Frequency = dataReader.GetInt32(4); mnga.ImplementationTime = dataReader.GetInt32(5); mnga.TotalCost = dataReader.GetString(6); list.Add(mnga); } dataReader.Close(); command.Dispose(); connection.Close(); } catch (Exception ex) { return(null); } return(list); }
public void NewMarketingAction(MarketingAction entity, string link) { var desc = H.strong["Срок акции: "] + entity.DateInterval + H.br + entity.Description + H.br + link; Send(info, context, desc, "[Акция]" + entity.Name, ForNewEntity); }
public static HashSet <string> GetCourseTCs(MarketingAction action, HashSet <string> withWebinar) { if (action.CourseTCList == MarketingAction.WithWebinar) { return(withWebinar); } return(new HashSet <string>(action.CourseTCSplitList)); }
public static string GetPromocode(MarketingAction action, Student student) { if (action.MarketingAction_ID == MarketingActions.Panasonic) { var promocode = MarketingActions.GetPanasonicPromocode(student.GetOrDefault(x => x.IsRealSpecialist)); return(H.p["Промокод: " + promocode].ToString()); } return(null); }
// POST api/marketingaction public MarketingAction Post(MarketingAction mrkAction) { if (mrkActionService.Insert(mrkAction)) { mrkAction.ID = Program.GetLastId(); return(mrkAction); } return(null); }
// PUT api/marketingaction/5 public MarketingAction Put(int id, MarketingAction newMarketingAction) { newMarketingAction.ID = id; if (mrkActionService.SearchId(id).Count > 0) { if (mrkActionService.Edit(newMarketingAction)) { return(newMarketingAction); } } return(null); }
// DELETE api/marketingaction/5 public MarketingAction Delete(int id) { MarketingAction oldMarketingAction = new MarketingAction(); var data = mrkActionService.SearchId(id); if (data.Count > 0) { oldMarketingAction.SetMarketingAction(data.ElementAt(0)); if (mrkActionService.DeleteId(id)) { return(oldMarketingAction); } } return(null); }
public static TagA MarketingActionLink(this HtmlHelper helper, MarketingAction action) { return(helper.Url().Link <CenterController>(c => c.MarketingAction(action.UrlName), action.Name)); }
public bool Edit(MarketingAction mnga) { sql = "UPDATE marketing SET business_plans_bpID='" + mnga.BusinessPlanId + "', title='" + mnga.Title + "', implementation='" + mnga.ImplementationTime + "',frequency='" + mnga.Frequency + "',implementationCost='" + mnga.ImplementationCost + "',totalCost='" + mnga.TotalCost + "' WHERE marketing_actionID='" + mnga.ID + "'"; return(EditTable()); }
public bool Insert(MarketingAction mnga) { sql = "INSERT INTO marketing (business_plans_bpID, title, implementation,frequency,implementationCost,totalCost) VALUES ('" + mnga.BusinessPlanId + "' , '" + mnga.Title + "' , '" + mnga.ImplementationTime + "' , '" + mnga.Frequency + "', '" + mnga.ImplementationCost + "', '" + mnga.TotalCost + "' )"; return(EditTable()); }
public static TagBuilder MarketingActionSmall(MarketingAction marketingAction) { return(HtmlControls.Image( Urls.Image("MarketingAction/Small/" + marketingAction.UrlName + ".jpg"), marketingAction.Name)); }