protected void Page_Load(object sender, EventArgs e) { ItemGuid = ParmParser.GetGuidIDFromQuery(); if (ItemGuid != Guid.Empty) { cmdSave.Text = "Save"; } else { ItemGuid = Guid.NewGuid(); txtID.Text = ItemGuid.ToString(); cmdSave.Text = "Add"; cmdClone.Visible = false; cmdDelete.Visible = false; btnDelete.Visible = false; } if (!IsPostBack) { txtDate.Text = DateTime.Now.Date.ToShortDateString(); var itm = (from c in db.tblCalendars where c.CalendarID == ItemGuid select c).FirstOrDefault(); if (itm != null) { txtDate.Text = Convert.ToDateTime(itm.EventDate).ToShortDateString(); reContent.Text = itm.EventDetail; txtEvent.Text = itm.EventTitle; chkActive.Checked = Convert.ToBoolean(itm.IsActive); } } txtID.Text = ItemGuid.ToString(); }
protected void Page_Load(object sender, EventArgs e) { ItemGuid = ParmParser.GetGuidIDFromQuery(); if (ItemGuid != Guid.Empty) { cmdSave.Text = "Save"; } else { ItemGuid = Guid.NewGuid(); txtID.Text = ItemGuid.ToString(); cmdSave.Text = "Add"; cmdClone.Visible = false; cmdDelete.Visible = false; btnDelete.Visible = false; } if (!IsPostBack) { var itm = (from c in db.tblFAQs where c.FaqID == ItemGuid select c).FirstOrDefault(); if (itm != null) { reQuestion.Text = itm.Question; reAnswer.Text = itm.Answer; txtSort.Text = itm.SortOrder.ToString(); chkActive.Checked = Convert.ToBoolean(itm.IsActive); } } txtID.Text = ItemGuid.ToString(); }
protected void Page_Load(object sender, EventArgs e) { ItemGuid = ParmParser.GetGuidIDFromQuery(); if (!IsPostBack) { var itm = CalendarHelper.GetEvent(ItemGuid); var itmPro = CalendarHelper.GetProfile(itm.CalendarEventProfileID); litTitle.Text = itmPro.EventTitle; litTime.Visible = !itmPro.IsAllDayEvent; litTime.Text = String.Format(" {0:h:mm tt} ", CalendarHelper.GetFullDateTime(itmPro.EventStartTime)); litDate.Text = itm.EventDate.ToShortDateString(); CalendarHelper.SetTextboxToTimeSpan(txtEventStartTime, itm.EventStartTime); CalendarHelper.SetTextboxToTimeSpan(txtEventEndTime, itm.EventEndTime); chkIsCancelled.Checked = itm.IsCancelled; reContent.Text = itm.EventDetail; } }
public IEnumerable <EditItem> Parse(IEnumerable <string> tokens) { //defaults EditItem.Location location = EditItem.Location.Beginning; Hive hive = Hive.User; char[] charsToTrim = { '\'', '\"' }; foreach (var token in tokens) { string trimmed = token.Trim(charsToTrim); PathParser pathParser = new PathParser(trimmed); ParmParser parmParser = new ParmParser(trimmed); if (pathParser.IsPath) { var item = new EditItem(pathParser.Path, pathParser.Action, hive, location); editItemList.Add(item); } else if (parmParser.IsParm) { if (parmParser.HiveParm.HasValue) { hive = parmParser.HiveParm.Value; } if (parmParser.LocationParm.HasValue) { location = parmParser.LocationParm.Value; } } else { throw new Exception($"Bad parameter: {token}"); } } return(editItemList); }
protected void cmdSave_Click(object sender, System.EventArgs e) { ItemGuid = ParmParser.GetGuidIDFromQuery(); Save(); }