/// <summary> /// Opens the QCL Form. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { //Get Values off the arguments ImpacPersistenceManager pm = ImpacPersistenceManagerFactory.CreatePersistenceManager(); int proId = ProId.Get(context); int staffIdResponsible = StaffIdResponsible.Get(context); string comment = Comment.Get(context); if (String.IsNullOrWhiteSpace(comment)) { comment = String.Empty; } //Check if values exist in the database. var prompt = pm.GetEntity <Prompt>(new PrimaryKey(typeof(Prompt), proId)); if (prompt.IsNullEntity) { throw new InvalidOperationException("Cannot find QCL Procedure (Prompt) record with Pro_Id: " + proId); } var staffResponsible = pm.GetEntity <Staff>(new PrimaryKey(typeof(Staff), staffIdResponsible)); if (staffResponsible.IsNullEntity) { throw new InvalidOperationException("Cannot find Responsible (Staff) record with Staff_Id: " + staffIdResponsible); } int chkId = CallClarion.AddQclRecord(prompt.Text, comment, staffIdResponsible); ChkId.Set(context, chkId); }
/// <summary> /// Create the QCL record. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { var mgr = new QclManager { PM = PM }; int chkId = mgr.CreateQcl(PatId1.Get(context), TskId.Get(context), StaffIdResponsible.Get(context), StaffIdRequesting.Get(context), DueDate.Get(context), CGroup.Get(context), PrsId.Get(context), Instructions.Get(context), Comment.Get(context)); ChkId.Set(context, chkId); }
/// <summary> /// Checks for QCL's with attributes matching the parameters passed in. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { var mgr = new QclManager { PM = PM }; bool qclExists = mgr.CheckQclExists(PatId1.Get(context), TskId.Get(context), StaffIdResponsible.Get(context), StaffIdRequesting.Get(context), DueDate.Get(context), CGroup.Get(context), PrsId.Get(context), Instructions.Get(context), Comment.Get(context), Completed.Get(context)); QclExists.Set(context, qclExists); }