Inheritance: Record
コード例 #1
0
ファイル: EventController.cs プロジェクト: kcbridges/Machete
 //
 //
 private string _getTabRef(Event evnt)
 {
     return "/Event/Edit/" + Convert.ToString(evnt.ID);
 }
コード例 #2
0
ファイル: EventController.cs プロジェクト: kcbridges/Machete
 //
 //
 private string _getTabLabel(Event evnt, string locale)
 {
     return evnt.dateFrom.ToShortDateString() + " " + lcache.textByID(evnt.eventType, locale);
 }
コード例 #3
0
ファイル: EventController.cs プロジェクト: kcbridges/Machete
        public ActionResult Create(Event evnt, string userName)
        {
            UpdateModel(evnt);
            Event newEvent = _serv.Create(evnt, userName);

            return Json(new
            {
                sNewRef = _getTabRef(newEvent),
                sNewLabel = _getTabLabel(newEvent, CI.TwoLetterISOLanguageName),
                iNewID = newEvent.ID
            },
            JsonRequestBehavior.AllowGet);
        }
コード例 #4
0
ファイル: EventController.cs プロジェクト: kcbridges/Machete
 public ActionResult Create(int PersonID)
 {
     Event eventobj = new Event();
     eventobj.dateFrom = DateTime.Today;
     eventobj.dateTo = DateTime.Today;
     eventobj.PersonID = PersonID;
     return PartialView(eventobj);
 }
コード例 #5
0
ファイル: sharedUI.cs プロジェクト: kcbridges/Machete
 public bool eventValidate(ref Event _ev)
 {
     string prefix = "event" + _ev.ID + "-";
     WaitForElement(By.Id(prefix + "eventType"));
     Assert.AreEqual(_ev.eventType.ToString(), GetOptionValue(By.Id(prefix + "eventType")));
     Assert.AreEqual(_ev.dateFrom.ToShortDateString(), WaitForElement(By.Id(prefix + "dateFrom")).GetAttribute("value"));
     if (_ev.dateTo != null)
         Assert.AreEqual(((DateTime)_ev.dateTo).ToShortDateString(), WaitForElement(By.Id(prefix + "dateTo")).GetAttribute("value"));
     Assert.AreEqual(_ev.notes, WaitForElement(By.Id(prefix + "notes")).GetAttribute("value"));
     return true;
 }
コード例 #6
0
ファイル: sharedUI.cs プロジェクト: kcbridges/Machete
 public bool eventCreate(Event _ev)
 {
     string prefix = "event"+ _ev.ID +"-";
     WaitThenClickElement(By.Id("eventCreateTab"));
     WaitForElement(By.Id(prefix + "eventType"));
     SelectOptionByValue(By.Id(prefix + "eventType"), _ev.eventType.ToString());
     WaitForElement(By.Id(prefix + "dateFrom")).Clear();
     WaitForElement(By.Id(prefix + "dateFrom")).SendKeys(_ev.dateFrom.ToShortDateString());
     if (_ev.dateTo != null)
     {
         WaitForElement(By.Id(prefix + "dateTo")).Clear();
         WaitForElement(By.Id(prefix + "dateTo")).SendKeys(((DateTime)_ev.dateTo).ToShortDateString());
     }
     WaitForElement(By.Id(prefix + "notes")).SendKeys(_ev.notes);
     WaitThenClickElement(By.Id("eventCreateBtn"));
     Thread.Sleep(1000); // need tabs to change; should build label and wait on it
     var selectedTab = _d.FindElements(By.CssSelector("li.ui-tabs-selected"))[1];
     IWebElement tabAnchor = selectedTab.FindElement(By.CssSelector("a"));
     _ev.ID = Convert.ToInt32(tabAnchor.GetAttribute("recordid"));
     return true;
 }