public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; try { string r = ""; string t = context.Request.Form["r"]; switch (t) { default: case "wd": r = new Weekly().Determine(); break; case "a": r = new Weekly().Actions(); break; } context.Response.Write("<html><head><link href=\"CSS/Chandam.css\" type=\"text/css\" rel=\"Stylesheet\" /></head><body><h1>Reports</h1>" + r + "</body></html>"); } catch { context.Response.Write(""); } }
/// <summary> /// Add the task to the configuration /// </summary> /// <exception cref="System.InvalidOperationException"> /// Missing the attributes for the Monthly task /// or /// Recursion is not set /// </exception> public override void Add() { IRecur recur = null; switch (_recursion) { case Recursion.Daily: recur = new Daily(_repeat); break; case Recursion.Weekly: recur = new Weekly(_repeat, _weekdays); break; case Recursion.Monthly: if (_weeks != Tasks.Weeks.None && _weekdays != Tasks.Weekdays.None && _months != Tasks.Months.None) { recur = new MonthlyByWeekdays(_months, _weekdays, _weeks); } else if (_days > 1 && _months != Tasks.Months.None) { recur = new MonthlyByDay(_months, _days); } else { throw new InvalidOperationException($"Missing the attributes for the Monthly task"); } break; default: throw new InvalidOperationException("Recursion is not set"); } Config.InternalRunners.Add(new ScheduledTaskRunner(Name, TaskType, Parameters, recur, _startDate, _taskTime, _timeZone, TraceType)); }
public SubscriptionFactory() { hourly = CreateHourly(); daily = CreateDaily(); weekly = CreateWeekly(); familyThreeDiscounts = CreateFamilyThreeDiscounts(); familyFiveDiscounts = CreateFamilyFiveDiscounts(); }
public void Equlity() { var x = new Weekly(2000, Week.W1); var y = new Weekly(2001, Week.W32); ValueTestUtility.TestEquality(x, x); ValueTestUtility.TestUnequlity(x, y); ValueTestUtility.TestComarisonWithNull(x); }
public ScheduleDefinition() { StartDate = Controller.ScheduleController.GetToday(); Type = ScheduleType.Weekly; DaylyPeriod = new Dayly(); WeeklyPeriod = new Weekly(); MonthlyPeriod = new Monthly(); YearlyPeriod = new Yearly(); }
public void Create() { var year = new Weekly(2000, Week.W1); var year2 = new Weekly(2001, Week.W32); Assert.AreEqual(2000, year.Year); Assert.AreEqual(Week.W1, year.Week); Assert.AreEqual(2001, year2.Year); Assert.AreEqual(Week.W32, year2.Week); }
public async Task Weekly() { var weekly = WeeklyDb.GetWeekly(Context.User.Id, Context.Guild.Id); if (weekly == null) { weekly = new Weekly { GuildId = Context.Guild.Id, UserId = Context.User.Id }; } int hours = 164; if (PremiumDb.IsPremium(Context.Guild.Id, ProType.Guild) || PremiumDb.IsPremium(Context.Guild.Id, ProType.GuildPlus)) { hours /= 2; } if (weekly.Date.AddHours(hours).CompareTo(DateTime.Now) < 0) { int streak = await DailyDb.GetHighest(Context.Guild.Id) + 15; int amount = ToastieUtil.DailyAmount(streak); int tax = ToastieUtil.DailyTax(amount, BalanceDb.GetToasties(Context.User.Id, Context.Guild.Id), BalanceDb.GetToasties(Context.Client.CurrentUser.Id, Context.Guild.Id), await BalanceDb.TotalToasties(Context.Guild.Id)); amount -= tax / 2; if (PremiumDb.IsPremium(Context.Guild.Id, ProType.GuildPlus)) { amount += 1000; } string text = ""; if (PremiumDb.IsPremium(Context.User.Id, ProType.ProPlus)) { await LootBoxDb.AddLootbox(Context.User.Id, LootBoxType.WaifuT1, 1, Context.Guild.Id); text = "You receive a T1 Waifu lootbox! :star2:"; } await BalanceDb.AddToasties(Context.User.Id, amount, Context.Guild.Id); await BalanceDb.AddToasties(Context.Client.CurrentUser.Id, tax / 2, Context.Guild.Id); weekly.Date = DateTime.Now; await WeeklyDb.SetWeekly(weekly); await Context.Channel.SendMessageAsync(text, false, ToastieUtil.WeeklyGetEmbed(amount, BalanceDb.GetToasties(Context.User.Id, Context.Guild.Id), Context.User, Program.GetPrefix(Context)).Build()); return; } await Context.Channel.SendMessageAsync("", false, ToastieUtil.WeeklyWaitEmbed(weekly.Date.AddHours(hours), Context.User, Program.GetPrefix(Context)).Build()); }
protected void Page_Load(object sender, EventArgs e) { Page.Form.DefaultFocus = TextBoxSearch.ClientID; Page.Form.DefaultButton = ButtonSearch.UniqueID; if (!IsPostBack) { string searchValue = "%"; GridViewResult.DataSource = Weekly.GetWeeklyListByFilter(searchValue); GridViewResult.DataBind(); } }
public ActionResult SubmitWeekly(Weekly weekly) { weekly.Score = 0; weekly.SubTime = DateTime.Now; weekly.avgScore = 0; weekly.Upvote = "0"; if (weeklyService.AddEntity(weekly)) { return(Content(SerializeHelper.SerializeToString(new { state = 0, msg = "提交成功" }))); } else { return(Content(SerializeHelper.SerializeToString(new { state = 1, msg = "提交失败" }))); } }
static void Main(string[] args) { Weekly 오늘은무슨요일이지 = Weekly.월; switch (오늘은무슨요일이지) { case Weekly.월: case Weekly.화: case Weekly.수: case Weekly.목: case Weekly.금: Console.WriteLine("학원가는날"); break; case Weekly.토: case Weekly.일: Console.WriteLine("빡세게 자습하는날"); break; } }
private void BindWeekly() { try { Weekly weekly = Weekly.GetWeeklyByWeeklyId(this.weeklyId); TextBoxDescription.Text = weekly.Description; } catch (System.Data.SqlClient.SqlException sqlEx) { for (int i = 0; i < sqlEx.Errors.Count; i++) { LabelError.Text += (sqlEx.Errors[i].Message + "<br />"); } PanelError.Visible = true; } catch (Exception exception) { LabelError.Text += (exception.Message + "<br />"); PanelError.Visible = true; } }
protected void ButtonSave_Click(object sender, EventArgs e) { if (Page.IsValid) { Weekly weekly = new Weekly(); weekly.WeeklyId = this.weeklyId; weekly.Description = TextBoxDescription.Text; weekly.ModifiedUser = Context.User.Identity.GetUserName(); try { weekly.Save(); int weeklyId = weekly.WeeklyId; Button clickedButton = (Button)sender; switch (clickedButton.ID) { case "ButtonSave": Response.Redirect(String.Format("WeeklyList.aspx?Description={0}", weekly.Description)); break; case "ButtonSaveNew": Response.Redirect("WeeklyEdit.aspx"); break; } } catch (System.Data.SqlClient.SqlException sqlEx) { LabelError.Text = ""; for (int i = 0; i < sqlEx.Errors.Count; i++) { ErrorMessage.Text += (sqlEx.Errors[i].Message + "<br />"); } } } }
public String Method4(Weekly enumTest, out string Outreparam) { Outreparam = "jjjj"; return("out"); }
public void Method4(Weekly enumTest) { }
protected void ButtonSearch_Click(object sender, EventArgs e) { GridViewResult.DataSource = Weekly.GetWeeklyListByFilter("%" + TextBoxSearch.Text + "%"); GridViewResult.DataBind(); }
public string SearchQuery() { return(Today.ToString() + "/" + Weekly.ToString() + "/" + Monthly.ToString() + "/" + Annually.ToString() + "/" + UsedTotal.ToString()); }