public void EXEC_usp_open_request_tab() { using (var db = new SNAPDatabaseDataContext()) { var req = db.SNAP_Requests.Single(x => x.submittedBy == "UnitTester"); var accessReq = new AccessRequest(req.pkId); accessReq.Ack(); } using (var db = new SNAPDatabaseDataContext()) { var req = db.SNAP_Requests.Single(x => x.submittedBy == "UnitTester"); Assert.IsTrue(req.statusEnum == (byte)RequestState.Pending); var accessReq = new AccessRequest(req.pkId); accessReq.RequestToChange("TEST"); } usp_open_request_tabResult t = new usp_open_request_tabResult(); t.requestId = 0; t.userId = "test"; t.userDisplayName = "test"; t.userTitle = "test"; t.submittedBy = "test"; t.managerUserId = "test"; t.managerDisplayName = "test"; t.statusEnum = 0; t.isChanged = false; t.ticketNumber = "test"; t.fieldId = 0; t.fieldLabel = "test"; t.fieldText = "ttest"; t.modifiedDate = DateTime.Now; t.createdDate = DateTime.Now; using (var db = new SNAPDatabaseDataContext()) { var req = db.SNAP_Requests.Single(x => x.submittedBy == "UnitTester"); Assert.IsTrue(req.statusEnum == (byte)RequestState.Change_Requested); var test = db.usp_open_request_tab(req.userId, req.pkId).First(); Assert.IsTrue(test.requestId > 0); Console.WriteLine(test.requestId); Console.WriteLine(test.userId); Console.WriteLine(test.userDisplayName); Console.WriteLine(test.userTitle); Console.WriteLine(test.submittedBy); Console.WriteLine(test.managerUserId); Console.WriteLine(test.managerDisplayName); Console.WriteLine(test.statusEnum); Console.WriteLine(test.isChanged); Console.WriteLine(test.ticketNumber); Console.WriteLine(test.fieldId); Console.WriteLine(test.fieldLabel); Console.WriteLine(test.fieldText); Console.WriteLine(test.modifiedDate); Console.WriteLine(test.createdDate); } }
private List<usp_open_request_tabResult> loadRequestFormData() { if (!string.IsNullOrEmpty(SnapSession.SelectedRequestId)) { var requestId = System.Convert.ToInt32(SnapSession.SelectedRequestId); var db = new SNAPDatabaseDataContext(); var formData = db.usp_open_request_tab(SnapSession.CurrentUser.LoginId, requestId); // formData contain history of all data fields, we are only interested in the latest return formData.ToList(); } return new List<usp_open_request_tabResult>(); }