// shows the form with default values for comboboxes and pickers // links: // docLink: http://sql2x.org/documentationLink/f5685d96-a0bb-4f7b-beaa-b3d578c7cf28 public void ShowAsAdd(string systemName, string testArea, string testSubArea, string testAddress, System.Guid userId, System.DateTime dateTime) { try { _contract = new CrudeDefaultTestContract(); _isNew = true; _contract.SystemName = systemName; textBoxSystemName.Text = _contract.SystemName; _contract.TestArea = testArea; textBoxTestArea.Text = _contract.TestArea; _contract.TestSubArea = testSubArea; textBoxTestSubArea.Text = _contract.TestSubArea; _contract.TestAddress = testAddress; textBoxTestAddress.Text = _contract.TestAddress; _contract.UserId = userId; _contract.DateTime = dateTime; dateTimePickerDateTime.Value = _contract.DateTime != DateTime.MinValue ? _contract.DateTime : dateTimePickerDateTime.MinDate; dateTimePickerDateTime.Checked = _contract.DateTime != DateTime.MinValue; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
// shows the form in edit modus // links: // docLink: http://sql2x.org/documentationLink/49afd26c-4f21-4992-967b-be190eacef77 public void ShowAsEdit(System.Guid defaultTestId) { var service = new CrudeDefaultTestServiceClient(); _isNew = false; try { _contract = service.FetchByDefaultTestId(defaultTestId); textBoxSystemName.Text = _contract.SystemName; textBoxTestArea.Text = _contract.TestArea; textBoxTestSubArea.Text = _contract.TestSubArea; textBoxTestAddress.Text = _contract.TestAddress; dateTimePickerDateTime.Value = _contract.DateTime != DateTime.MinValue ? _contract.DateTime : dateTimePickerDateTime.MinDate; dateTimePickerDateTime.Checked = _contract.DateTime != DateTime.MinValue; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } finally { service.Close(); } }
public ActionResult CrudeDefaultTestEdit([Bind()] CrudeDefaultTestContract contract) { if (ModelState.IsValid) { new CrudeDefaultTestServiceClient().Update(contract); return(RedirectToAction("CrudeDefaultTestIndex")); } return(View( "~/Views/Crude/Default/CrudeDefaultTest/CrudeDefaultTestEdit.cshtml", contract )); }
public ActionResult DefaultTestEdit( [Bind()] CrudeDefaultTestContract testContract ) { //new DefaultTestServiceClient(). // DefaultTestCompleteUpdate( // Guid.Empty, // testContract, // new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}") // ); return(RedirectToAction( "DefaultTestEdit", new { defaultTestId = Guid.Empty } )); }
public ActionResult CrudeDefaultTestCreate(System.Guid?userId) { var contract = new CrudeDefaultTestContract(); if (userId != null) { contract.UserId = (System.Guid)userId; } contract.DateTime = DateTime.UtcNow; return(View( "~/Views/Crude/Default/CrudeDefaultTest/CrudeDefaultTestCreate.cshtml", contract )); }
// shows the form with default values for comboboxes and pickers // links: // docLink: http://sql2x.org/documentationLink/e04d0806-55ef-41cc-8669-acf0ddd850c7 public void ShowAsAdd() { try { _contract = new CrudeDefaultTestContract(); _isNew = true; this.Text += " - Not Savable (User Missing)"; Show(); } catch (Exception ex) { if (ex == null) { } else { System.Diagnostics.Debugger.Break(); } } }
public ActionResult DefaultTestCreate([Bind()] CrudeDefaultTestContract testContract) { if (ModelState.IsValid) { //new CrudeDefaultTestServiceClient().Insert(testContract.DefaultTestNew); return(RedirectToAction( "DefaultTestEdit", new { defaultTestId = Guid.Empty } )); } return(View( "~/Views/Templates/DefaultTest/DefaultTest/DefaultTestCreate.cshtml", testContract )); }
public ActionResult DefaultTestCreate(System.Guid?userId) { var testContract = new CrudeDefaultTestContract(); //testContract.DefaultTestNew = new CrudeDefaultTestContract(); //if (userId != null) testContract.DefaultTestNew.UserId = (System.Guid)userId; //if (userId == null) // testContract.DefaultTestNew.UserId = new System.Guid("{FFFFFFFF-5555-5555-5555-FFFFFFFFFFFF}"); //ViewBag.DefaultUserName = // new CrudeDefaultUserServiceClient().FetchByDefaultUserId(testContract.DefaultTestNew.UserId).DefaultUserName; //testContract.DefaultTestNew.DateTime = DateTime.UtcNow; return(View( "~/Views/Templates/DefaultTest/DefaultTest/DefaultTestCreate.cshtml", testContract )); }
private void TryCall( string systemName, string testArea, string url ) { WebClient client = new WebClient(); string html = string.Empty; WebHeaderCollection headers = null; CrudeDefaultTestContract test = new CrudeDefaultTestContract { DefaultTestId = Guid.NewGuid(), SystemName = systemName, TestArea = testArea, TestSubArea = " ", TestAddress = url, DateTime = DateTime.UtcNow, UserId = DefaultUserId }; CrudeDefaultTestRunContract testRun = new CrudeDefaultTestRunContract { DefaultTestId = test.DefaultTestId, DateTime = DateTime.UtcNow, UserId = DefaultUserId }; try { testRun.StartDateTime = DateTime.UtcNow; // download page LoggingTime time = LoggingTime.PerformanceTimeStart("tryCall"); html = client.DownloadString(url); time.PerformanceTimeStop(); testRun.ElapsedMilliseconds = (int)time.StopWatch.ElapsedMilliseconds; testRun.EndDateTime = DateTime.UtcNow; headers = client.ResponseHeaders; testRun.Result = headers.ToString(); testRun.DefaultTestRunResultRcd = DefaultTestRunResultRef.OK; } catch (WebException ex) { testRun.DefaultTestRunResultRcd = DefaultTestRunResultRef.WebException; testRun.Result = "Status: " + ex.Status + ", Response: " + ex.Response + " : " + url; //Error(ex); } catch (Exception ex) { testRun.DefaultTestRunResultRcd = DefaultTestRunResultRef.Exception; testRun.Result = "Message: " + ex.Message + " : " + url; //Error(ex); } // truncate result if (testRun.Result.Length > 240) { testRun.Result = testRun.Result.Substring(0, 240); } try { //new CrudeDefaultTestServiceClient().Insert(test); //new CrudeDefaultTestRunServiceClient().Insert(testRun); Console.WriteLine($"{testRun.DefaultTestRunResultRcd} {testRun.ElapsedMilliseconds} {test.TestAddress}"); var defaultTest = new DefaultTestServiceClient(); defaultTest.AddTestRun( test.SystemName, test.TestArea, test.TestSubArea, test.TestAddress, testRun.StartDateTime, testRun.EndDateTime, testRun.ElapsedMilliseconds, testRun.DefaultTestRunResultRcd, testRun.Result, testRun.UserId ); } catch (Exception ex) { if (ex != null) { } } //Log(systemName, testArea, testRun.DefaultTestRunResultRcd); }