|
1 | | -using BExIS.Emm.Entities.Event; |
| 1 | +using BExIS.Dcm.CreateDatasetWizard; |
| 2 | +using BExIS.Dcm.Wizard; |
| 3 | +using BExIS.Emm.Entities.Event; |
2 | 4 | using BExIS.Emm.Services.Event; |
3 | 5 | using BExIS.IO.Transform.Output; |
4 | 6 | using BExIS.Modules.EMM.UI.Helper; |
@@ -29,6 +31,8 @@ namespace BExIS.Modules.EMM.UI.Controllers |
29 | 31 | public class EventRegistrationResultController : Controller |
30 | 32 | { |
31 | 33 |
|
| 34 | + private CreateTaskmanager TaskManager; |
| 35 | + |
32 | 36 | #region Show Event Registration Results |
33 | 37 |
|
34 | 38 | public ActionResult Show() |
@@ -216,6 +220,85 @@ private void SendNotification(XmlDocument data, Event e) |
216 | 220 |
|
217 | 221 | } |
218 | 222 |
|
| 223 | + #endregion |
| 224 | + |
| 225 | + #region edit event registration |
| 226 | + |
| 227 | + public ActionResult LoadForm(long id, long eventid) |
| 228 | + { |
| 229 | + using (EventManager eManager = new EventManager()) |
| 230 | + { |
| 231 | + Event e = eManager.EventRepo.Get(eventid); |
| 232 | + |
| 233 | + //add default value to session |
| 234 | + DefaultEventInformation defaultEventInformation = new DefaultEventInformation(); |
| 235 | + defaultEventInformation.EventName = e.Name; |
| 236 | + defaultEventInformation.Id = e.Id.ToString(); |
| 237 | + if (!String.IsNullOrEmpty(e.EventDate)) |
| 238 | + defaultEventInformation.Date = e.EventDate; |
| 239 | + if (!String.IsNullOrEmpty(e.EventLanguage)) |
| 240 | + defaultEventInformation.Language = e.EventLanguage; |
| 241 | + |
| 242 | + if (!String.IsNullOrEmpty(e.ImportantInformation)) |
| 243 | + defaultEventInformation.ImportantInformation = e.ImportantInformation; |
| 244 | + |
| 245 | + Session["DefaultEventInformation"] = defaultEventInformation; |
| 246 | + |
| 247 | + //CreateTaskmanager taskManager = new CreateTaskmanager(); |
| 248 | + if (TaskManager == null) |
| 249 | + TaskManager = new CreateTaskmanager(); |
| 250 | + |
| 251 | + TaskManager.AddToBus(CreateTaskmanager.METADATASTRUCTURE_ID, e.MetadataStructure.Id); |
| 252 | + TaskManager.AddToBus(CreateTaskmanager.ENTITY_ID, e.Id); |
| 253 | + |
| 254 | + using (EventRegistrationManager erManager = new EventRegistrationManager()) |
| 255 | + { |
| 256 | + |
| 257 | + EventRegistration reg = erManager.EventRegistrationRepo.Get(a => a.Id == id).FirstOrDefault(); |
| 258 | + XmlNodeReader xmlNodeReader = new XmlNodeReader(reg.Data); |
| 259 | + TaskManager.AddToBus(CreateTaskmanager.METADATA_XML, reg.Data); |
| 260 | + xmlNodeReader.Dispose(); |
| 261 | + } |
| 262 | + |
| 263 | + } |
| 264 | + |
| 265 | + TaskManager.AddToBus(CreateTaskmanager.SAVE_WITH_ERRORS, false); |
| 266 | + |
| 267 | + TaskManager.AddToBus(CreateTaskmanager.NO_IMPORT_ACTION, true); |
| 268 | + TaskManager.AddToBus(CreateTaskmanager.INFO_ON_TOP_TITLE, "Event registration"); |
| 269 | + TaskManager.AddToBus(CreateTaskmanager.INFO_ON_TOP_DESCRIPTION, "<p><b>help</b></p>"); |
| 270 | + |
| 271 | + |
| 272 | + Session["EventRegistrationTaskmanager"] = TaskManager; |
| 273 | + |
| 274 | + setAdditionalFunctions(); |
| 275 | + |
| 276 | + return new EmptyResult(); |
| 277 | + |
| 278 | + } |
| 279 | + private void setAdditionalFunctions() |
| 280 | + { |
| 281 | + CreateTaskmanager taskManager = (CreateTaskmanager)Session["EventRegistrationTaskmanager"]; |
| 282 | + |
| 283 | + |
| 284 | + ActionInfo submitAction = new ActionInfo(); |
| 285 | + submitAction.ActionName = "Save"; |
| 286 | + submitAction.ControllerName = "EventRegistration"; |
| 287 | + submitAction.AreaName = "EMM"; |
| 288 | + |
| 289 | + ActionInfo cancelAction = new ActionInfo(); |
| 290 | + cancelAction.ActionName = "Cancel"; |
| 291 | + cancelAction.ControllerName = "EventRegistration"; |
| 292 | + cancelAction.AreaName = "EMM"; |
| 293 | + |
| 294 | + taskManager.Actions.Add(CreateTaskmanager.SUBMIT_ACTION, submitAction); |
| 295 | + taskManager.Actions.Add(CreateTaskmanager.CANCEL_ACTION, cancelAction); |
| 296 | + |
| 297 | + Session["EventRegistrationTaskmanager"] = taskManager; |
| 298 | + |
| 299 | + } |
| 300 | + |
| 301 | + |
219 | 302 | #endregion |
220 | 303 |
|
221 | 304 | #region Xml to DataTable |
|
0 commit comments