public override void Save() { if (FM.DB.ActivityBF.HasErrors) { UIHelper.TableHasErrorsOnSaveMessBox(FM.DB); } else { try { this.activityBFBindingSource.EndEdit(); atLogic.BusinessProcess bp = FM.GetBP(); bp.AddForUpdate(FM.GetActivityBF()); bp.AddForUpdate(FM.EFile); bp.Update(); ApplyBR(true); fFile f = (fFile)this.ParentForm; f.fileToc.LoadTOC(); } catch (Exception x) { throw x; } } }
public void BindActivityBFData(lmDatasets.atriumDB.ActivityBFDataTable dtBF) { UIHelper.ComboBoxInit(FM.AtMng.acMng.DB.ACBF, activityBFGridEX.DropDowns["ddACBFId"], FM); UIHelper.ComboBoxInit("vRoleucontacttype", activityBFGridEX.DropDowns["ddRoleCode"], FM); UIHelper.ComboBoxInit(FM.AtMng.acMng.DB.ACSeries, activityBFGridEX.DropDowns["ddAcSeries"], FM); UIHelper.ComboBoxInit("vOfficerList", activityBFGridEX.DropDowns["ddOfficer"], FM); ucBFOfficerId.FM = FM; ucContactSelectBox1.FM = FM; priorityJComboBox.ImageList = UIHelper.browseImgList(); priorityJComboBox.Items.Add(new Janus.Windows.EditControls.UIComboBoxItem(LawMate.Properties.Resources.PriorityNormal, 0, 36)); priorityJComboBox.Items.Add(new Janus.Windows.EditControls.UIComboBoxItem(LawMate.Properties.Resources.PriorityHigh, 1, 34)); priorityJComboBox.Items.Add(new Janus.Windows.EditControls.UIComboBoxItem(LawMate.Properties.Resources.PriorityUrgent, 2, 35)); editBox1.DataBindings.Add("Text", activityBFBindingSource, UIHelper.Translate(FM, "BFDescriptionEng")); DataView dv = new DataView(dtBF, "", "", DataViewRowState.ModifiedCurrent | DataViewRowState.Unchanged); activityBFBindingSource.DataSource = dv; activityBFBindingSource.DataMember = ""; //activityBFBindingSource.Filter = "not (isMail=1 and BFOfficerid<>" + FM.AtMng.WorkingAsOfficer.OfficerId.ToString() + ")"; dtBF.ColumnChanged += new DataColumnChangeEventHandler(dtBF_ColumnChanged); FM.GetActivityBF().OnUpdate += new atLogic.UpdateEventHandler(ucActivityBF_OnUpdate); if (dtBF.Rows.Count == 0) { UIHelper.EnableControls(activityBFBindingSource, false); } }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && !FileForm().ReadOnly&& dr != null) { atriumDB.ActivityBFRow ar = (atriumDB.ActivityBFRow)dr; if (dr.RowState == DataRowState.Added) { ucBFOfficerId.Visible = true; ebBFPerson.Visible = false; UIHelper.EnableControls(activityBFBindingSource, true); } else { ucBFOfficerId.Visible = false; ebBFPerson.Visible = true; UIHelper.EnableControls(activityBFBindingSource, FM.GetActivityBF().CanEditBF(ar)); } if (ar.Completed) { cmdCompleteBF.Image = LawMate.Properties.Resources.checkboxFalse; cmdCompleteBF.Text = LawMate.Properties.Resources.UncompleteBF; cmdCompleteBF.ToolTipText = LawMate.Properties.Resources.UncompleteBF; } else { cmdCompleteBF.Image = LawMate.Properties.Resources.checkbox; cmdCompleteBF.Text = LawMate.Properties.Resources.CompleteBF; cmdCompleteBF.ToolTipText = LawMate.Properties.Resources.CompleteBF; } if (FM.GetActivityBF().CanEditBF(ar)) { cmdCompleteBF.Enabled = Janus.Windows.UI.InheritableBoolean.True; } else { cmdCompleteBF.Enabled = Janus.Windows.UI.InheritableBoolean.False; } } if (dr == null) { UIHelper.EnableControls(activityBFBindingSource, false); } }
private void AutoAC(atriumDB.ActivityRow prevAC, ActivityConfig.ACSeriesRow asr, int revId, ACEngine.RevType revType, DateTime acDate, Stack <ParentChildStep> _flowQ, bool recurse) { FileManager fmp = FM; try { if (asr.InitialStep == (int)ACEngine.Step.CreateFile) { myFM = FM.AtMng.CreateFile(fmp); prevAC = null; revId = 0; } ACEngine ace; atriumDB.ActivityRow newAC; DoACAllSteps(prevAC, asr, revId, revType, acDate, out ace, out newAC, _flowQ, null); LastActivityId = newAC.ActivityId; FM.GetActivity().CalculateBF(newAC, revId != 0, false); if (PrototypeAC != null) { if (!PrototypeAC.IsActivityCommentNull()) { newAC.ActivityComment = PrototypeAC.ActivityComment; } //copy user bfs foreach (atriumDB.ActivityBFRow abfr in PrototypeAC.GetActivityBFRows()) { if (abfr.ACBFId == ActivityBFBE.USERBFID) { atriumDB.ActivityBFRow newabfr = (atriumDB.ActivityBFRow)FM.GetActivityBF().Add(newAC); newabfr.BFDate = abfr.BFDate; newabfr.InitialBFDate = abfr.InitialBFDate; if (!abfr.IsBFCommentNull()) { newabfr.BFComment = abfr.BFComment; } newabfr.BFType = abfr.BFType; newabfr.BFOfficerID = abfr.BFOfficerID; } } } ace.Save(true, false); FM.GetDocMng().GetDocument().Send(newAC); //recurse to allow nested files if (recurse) { AutoNextStep(newAC); } } catch (Exception x) { myFM = fmp; throw x; } finally { myFM = fmp; } }