コード例 #1
0
        public override void ApplySecurity(DataRow dr)
        {
            SST.SSTDecisionRow cbr = (SST.SSTDecisionRow)dr;
            UIHelper.EnableControls(sSTDecisionBindingSource, SSTM.GetSSTDecision().CanEdit(cbr));
            UIHelper.EnableCommandBarCommand(tsDelete, SSTM.GetSSTDecision().CanDelete(cbr));

            isFinalUICheckBox.Enabled = false;
        }
コード例 #2
0
        protected override void AfterAdd(DataRow row)
        {
            SST.SSTDecisionRow dr         = (SST.SSTDecisionRow)row;
            string             ObjectName = this.mySSTDecisionDT.TableName;

            dr.SSTCaseId     = myA.DB.SSTCase[0].SSTCaseId;
            dr.SSTDecisionId = myA.AtMng.PKIDGet(ObjectName, 10);
            dr.IsFinal       = false;
            dr.FileId        = myA.FM.CurrentFileId;
            dr.IsCombined    = false;
        }
コード例 #3
0
        private void btnConfirmAppealGround_Click(object sender, EventArgs e)
        {
            if (SSTAppealGroundGridEX.GetCheckedRows().Length > 0)
            {
                try
                {
                    SST.SSTAppealGroundRow[] agra = (SST.SSTAppealGroundRow[])SSTM.DB.SSTAppealGround.Select("FileId=" + FM.CurrentFileId.ToString());

                    // delete existing appeal grounds
                    foreach (SST.SSTAppealGroundRow dr in agra)
                    {
                        SSTM.DB.SSTAppealGround.RemoveSSTAppealGroundRow(dr);
                    }

                    SST.SSTDecisionRow sdr = null;
                    foreach (SST.SSTDecisionRow sstd in SSTM.DB.SSTDecision)
                    {
                        //if (sstd.DecisionType == 4)
                        sdr = sstd;
                    }

                    SST.SSTAppealGroundRow sstagr;
                    // add new appeal grounds
                    foreach (Janus.Windows.GridEX.GridEXRow gexr in SSTAppealGroundGridEX.GetCheckedRows())
                    {
                        if (gexr.IsChecked)
                        {
                            sstagr = (SST.SSTAppealGroundRow)SSTM.GetSSTAppealGround().Add(sdr);
                            sstagr.AppealGroundId      = (int)gexr.Cells[0].Value;
                            sstagr.ConfirmedByMemberId = myFM.AtMng.WorkingAsOfficer.OfficerId;
                        }
                    }

                    appealGroundConfirmed = true;
                }
                catch (Exception x)
                {
                    UIHelper.HandleUIException(x);
                }
                OnValidated(new EventArgs());
                btnConfirmAppealGround.Enabled = false;
            }
            else
            {
                UIHelper.NoAppealGroundSelected();
            }
        }
コード例 #4
0
        //protected override void AfterUpdate(DataRow dr)
        //{

        //    SST.SSTAppealGroundRow agr = (SST.SSTAppealGroundRow)dr;

        //    bool granted = false;
        //    SST.SSTAppealGroundDataTable agdt = myDAL.LoadByFileId(agr.FileId);

        //    foreach (SST.SSTAppealGroundRow agrow in agdt)
        //    {
        //        if (!agrow.IsOutcomeIdNull() && agrow.OutcomeId == 9)
        //        {
        //            granted = true;
        //            break;
        //        }
        //    }

        //    atriumDAL.SSTDecisionDAL ddal = myA.AtMng.DALMngr.GetSSTDecision();
        //    SST.SSTDecisionDataTable ddt = ddal.Load(agr.SSTDecisonId);
        //    SST.SSTDecisionRow sstdr = (SST.SSTDecisionRow)ddt.Rows[0];

        //    if (granted)
        //    {
        //        sstdr.OutcomeId = 9; // granted
        //    }
        //    else
        //    {
        //        sstdr.OutcomeId = 10; // refused
        //    }

        //    sstdr.EndEdit();

        //}

        protected override void AfterChange(DataColumn dc, DataRow dr)
        {
            SST.SSTAppealGroundRow agr    = (SST.SSTAppealGroundRow)dr;
            SST.SSTDecisionRow[]   sstdrs = (SST.SSTDecisionRow[])myA.FM.GetSSTMng().DB.SSTDecision.Select("FileID = " + agr.FileId.ToString());

            foreach (SST.SSTDecisionRow decisionRow in sstdrs)
            {
                if (decisionRow.DecisionType == 4)
                {
                    agr.SSTDecisonId = decisionRow.SSTDecisionId;
                    break;
                }
            }

            switch (dc.ColumnName)
            {
            case "OutcomeId":     // set outcome to granted on SSTDecisionRow if at least 1 Appeal Ground is granted
                bool granted = false;
                foreach (SST.SSTAppealGroundRow agrow in mySSTAppealGroundDT)
                {
                    if (!agrow.IsOutcomeIdNull() && agrow.OutcomeId == 9)
                    {
                        granted = true;
                        break;
                    }
                }

                SST.SSTDecisionRow sstdr = agr.SSTDecisionRow;

                if (granted)
                {
                    sstdr.OutcomeId = 9;     // granted
                }
                else
                {
                    sstdr.OutcomeId = 10;     // refused
                }
                sstdr.EndEdit();
                break;
            }
        }
コード例 #5
0
 protected override void AfterChange(DataColumn dc, DataRow dr)
 {
     SST.SSTDecisionRow sdr = (SST.SSTDecisionRow)dr;
     switch (dc.ColumnName)
     {
     case "OutcomeId":
     case "DecisionDate":
         if (sdr.DecisionType == 3 && !sdr.IsDecisionDateNull())
         {
             SST.SSTCaseRow scr = myA.DB.SSTCase.FindBySSTCaseId(sdr.SSTCaseId);
             scr.Received365Date = sdr.DecisionDate.AddDays(365);
             scr.EndEdit();
         }
         if (!sdr.IsOutcomeIdNull())
         {
             CodesDB.OutcomeRow orr = myA.AtMng.CodeDB.Outcome.FindByOutcomeId(sdr.OutcomeId);
             sdr.IsFinal = orr.IsFinal;
         }
         break;
     }
 }
コード例 #6
0
        protected override void BeforeUpdate(DataRow dr)
        {
            SST.SSTDecisionRow sdr = (SST.SSTDecisionRow)dr;
            if (sdr.IsFinal)
            {
                SST.SSTCaseRow scr = sdr.SSTCaseRow;
                if (!sdr.IsDecisionDateNull())
                {
                    scr.DecisionDate = sdr.DecisionDate;
                }
                if (!sdr.IsDecisionSentDateNull())
                {
                    scr.DecisionSentDate = sdr.DecisionSentDate;
                }
                if (!sdr.IsOutcomeIdNull())
                {
                    scr.OutcomeId = sdr.OutcomeId;
                }

                scr.DecisionType = sdr.DecisionType;
            }
            BeforeChange("IsCombined", dr);
        }
コード例 #7
0
 protected override void AfterUpdate(DataRow row)
 {
     SST.SSTDecisionRow dr = (SST.SSTDecisionRow)row;
     EFileBE.XmlAddToc(myA.FM.CurrentFile, "sstdecision", "Tribunal Member Decisions", "Décisions de Membre du Tribunal", 112);
 }
コード例 #8
0
        protected override void BeforeChange(DataColumn dc, DataRow dr)
        {
            SST.SSTDecisionRow sdr = (SST.SSTDecisionRow)dr;
            switch (dc.ColumnName)
            {
            case "IsCombined":
                if (sdr.IsCombined)
                {
                    //must be "allowed"
                    if (!sdr.IsOutcomeIdNull() && sdr.OutcomeId == 10 && sdr.DecisionType == 4)
                    {
                        throw new AtriumException(Properties.Resources.SSTDecisionIsCombined);
                    }
                }
                break;

            case "DecisionDate":
                if (!sdr.IsDecisionDateNull())
                {
                    myA.IsValidDate(dc.ColumnName, sdr.DecisionDate, true, sdr.SSTCaseRow.ReceivedDate, DateTime.Today, atriumBE.Properties.Resources.SSTAppealDate, atriumBE.Properties.Resources.ValidationToday);
                }
                break;

            case "DecisionSentDate":
                if (!sdr.IsDecisionSentDateNull())
                {
                    myA.IsValidDate(dc.ColumnName, sdr.DecisionSentDate, true, sdr.SSTCaseRow.ReceivedDate, DateTime.Today, atriumBE.Properties.Resources.SSTAppealDate, atriumBE.Properties.Resources.ValidationToday);
                }
                break;

            case "DecisionType":
                if (!sdr.IsNull(dc))
                {
                    CodesDB.DecisionTypeRow dtr = myA.AtMng.CodeDB.DecisionType.FindByDecisionTypeId(sdr.DecisionType);
                    if (dtr.OncePerFile)
                    {
                        //check to see if there is already a design of this type
                        foreach (SST.SSTDecisionRow xsdr in mySSTDecisionDT)
                        {
                            if (xsdr.SSTDecisionId != sdr.SSTDecisionId && xsdr.DecisionType == sdr.DecisionType)
                            {
                                string msg = String.Format(atriumBE.Properties.Resources.SSTDecisionTypeDup, dtr["DecType" + myA.AppMan.Language].ToString());
                                myA.FM.RaiseWarning(WarningLevel.Interrupt, msg, myA.AtMng.AppMan.AppName);
                            }
                        }
                    }
                }
                else
                {
                    throw new RequiredException(dc.ColumnName);
                }
                break;

            case "OutcomeId":
                if (!sdr.IsOutcomeIdNull())
                {
                    CodesDB.OutcomeRow orr = myA.AtMng.CodeDB.Outcome.FindByOutcomeId(sdr.OutcomeId);
                    if (orr.DecisionType != sdr.DecisionType)
                    {
                        throw new AtriumException("Not a valid outcome for this decision type");
                    }
                }
                break;
            }
        }