예제 #1
0
        private void AddExtensionToFileFormatTable(string ext, docDB.FileFormatDataTable ffTable)
        {
            if (obe == null)
            {
                obe = AtMng.GetCodeTableBE("FileFormat");
                obe.Load();
            }

            CodesDB.FileFormatRow ffRow = (CodesDB.FileFormatRow)obe.Add(null);
            ffRow.AllowEdit    = false;
            ffRow.AllowPreview = false;
            ffRow.AllowSearch  = true;
            ffRow.AllowUpload  = true;
            ffRow.FileDescEng  = "Lotus Notes Import";
            ffRow.FileDescFre  = "Lotus Notes Import";
            ffRow.FileFormat   = ext;
            ffRow.IsBinary     = false;

            ffRow.EndEdit();
            atLogic.BusinessProcess bp = AtMng.GetBP();
            bp.AddForUpdate(obe);
            bp.Update();

            ffTable.ImportRow(ffRow);
        }
예제 #2
0
        public void LoadRoot(atriumManager atmng, int programId)
        {
            //load root
            if (UIHelper.AtMng.AppMan.Language.ToUpper() == "FRE")
            {
                SelectedIssueLangText = "IssueNameFre";
            }

            myFM = atmng.GetFile();
            //selectedIssue = myFM.CurrentFile;



            if (programId == 0)
            {
                LoadRootX(atmng, 0);
            }
            else
            {
                // load roots based on program issue
                atLogic.ObjectBE obe = atmng.GetCodeTableBE("ProgramIssue");
                if (obe.myDT.Rows.Count == 0)
                {
                    obe.Load();
                }
                CodesDB.ProgramIssueDataTable pidt = (CodesDB.ProgramIssueDataTable)obe.myDT;
                foreach (CodesDB.ProgramIssueRow pir in pidt)
                {
                    if (pir.ProgramId == programId)
                    {
                        LoadRootX(atmng, pir.IssueId);
                    }
                }
            }

            tvIssues.ExpandAll();
        }
예제 #3
0
        private void ApplyTribunalMemberFilter()
        {
            // code to apply filter criteria to memmebrs list
            if (CurrentRow() != null)
            {
                grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].ApplyFilter(null); // clear filter

                GridEXFilterCondition filtTribunalMember = new GridEXFilterCondition();

                if (this.chkLanguage.Checked) // add language filter
                {
                    if (CurrentRow().FileLanguageCode == "F")
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearFre"],
                                                                                  ConditionOperator.Equal, true));
                    }
                    else if (CurrentRow().FileLanguageCode == "E")
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearEng"],
                                                                                  ConditionOperator.Equal, true));
                    }
                    else
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearFre"],
                                                                                  ConditionOperator.Equal, true));
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearEng"],
                                                                                  ConditionOperator.Equal, true));
                    }
                }

                if (this.chkTraining.Checked) // add training filter
                {
                    // charter condition
                    if (CurrentRow().IsCharter)
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["TrainedCharter"],
                                                                                  ConditionOperator.Equal, true));
                    }

                    // program & benefit condition
                    if (!CurrentRow().IsAccountIdNull())
                    {
                        atLogic.ObjectBE obe = myAtMng.GetCodeTableBE("AccountType");
                        if (obe.myDT.Rows.Count == 0)
                        {
                            obe.Load();
                        }
                        CodesDB.AccountTypeDataTable atdt = (CodesDB.AccountTypeDataTable)obe.myDT;
                        CodesDB.AccountTypeRow       atr  = atdt.FindByAccountTypeId(CurrentRow().AccountId);

                        string trainedByProgramColumn = "";

                        switch (atr.ProgramID)
                        {
                        case 3:     // EI
                            trainedByProgramColumn = "TrainedEI";
                            break;

                        case 8:     // CPP
                            trainedByProgramColumn = "TrainedCPP";
                            break;

                        case 9:     // OAS
                            trainedByProgramColumn = "TrainedOAS";
                            break;
                        }

                        if (trainedByProgramColumn != "")
                        {
                            filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns[trainedByProgramColumn],
                                                                                      ConditionOperator.Equal, true));
                        }
                    }
                }

                if (this.chkLocation.Checked) // add location filter
                {
                    var memberId = new List <int>();

                    if (!CurrentRow().IsOfficeIdNull())
                    {
                        int selectedSCOfficeId = CurrentRow().OfficeId;

                        // get service centre latitude and longitude
                        lmDatasets.MemberManagement.OfficeSCListRow scr = myMemMng.DB.OfficeSCList.FindByOfficeId(selectedSCOfficeId);// myAtMng.OfficeMng.GetServiceCentre().Load(selectedSCOfficeId);

                        if (!scr.IsLatitudeNull() && !scr.IsLongitudeNull())
                        {
                            // get member postal code
                            double distance;

                            maxDistance = (int)maxDistanceEditBox.Value;

                            foreach (MemberManagement.MemberListAssignmentFilterRow mlafr in mListAssignmentFilter)
                            {
                                if (!mlafr.IsLatitudeNull())
                                {
                                    distance = myAtMng.GetPostalCodeLocation().CalculateDistance((double)mlafr.Latitude, (double)mlafr.Longitude, (double)scr.Latitude, (double)scr.Longitude);
                                    if (distance >= 0 && distance <= maxDistance)
                                    {
                                        memberId.Add(mlafr.OfficerId);
                                    }
                                }
                            }
                        }
                    }

                    if (memberId.Count == 0)
                    {
                        memberId.Add(-1);
                    }

                    GridEXFilterCondition filtLocation = new GridEXFilterCondition();
                    foreach (int memID in memberId)
                    {
                        if (filtLocation.Conditions.Count == 0)
                        {
                            filtLocation.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["OfficerId"], ConditionOperator.Equal, memID));
                        }
                        else
                        {
                            filtLocation.AddCondition(LogicalOperator.Or, new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["OfficerId"], ConditionOperator.Equal, memID));
                        }
                    }
                    filtTribunalMember.AddCondition(filtLocation);
                }

                // apply filter only if conditions exist
                if (filtTribunalMember.Conditions.Count > 0)
                {
                    grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].ApplyFilter(filtTribunalMember);
                }
            }
        }
예제 #4
0
        private void gridEX1_RowDoubleClick(object sender, RowActionEventArgs e)
        {
            try
            {
                uiPanel2.Closed = true;

                if (gridEX1.GetRow().RowType == RowType.Record)
                {
                    string  TblName;
                    DataRow dr = (DataRow)((DataRowView)gridEX1.GetRow().DataRow).Row;
                    TblName       = (string)dr["TableName"];
                    uiPanel1.Text = TblName;

                    for (int i = cGridEX.RootTable.Columns.Count - 1; i >= 0; i--)
                    {
                        cGridEX.RootTable.Columns.Remove(cGridEX.RootTable.Columns[i]);
                    }

                    obe = AtMng.GetCodeTableBE(TblName);
                    obe.Load();
                    cGridEX.DataSource = obe.myDT;
                    int y = 0;
                    for (int i = 0; obe.myDT.Columns.Count > i; i++)
                    {
                        if ((obe.myDT.Columns[i].ColumnName == "entryUser") ||
                            (obe.myDT.Columns[i].ColumnName == "entryDate") ||
                            (obe.myDT.Columns[i].ColumnName == "updateUser") ||
                            (obe.myDT.Columns[i].ColumnName == "updateDate") ||
                            (obe.myDT.Columns[i].ColumnName == "ts"))
                        {
                        }
                        else
                        {
                            if (cGridEX.RootTable.Columns.Count > i)
                            {
                            }
                            else
                            {
                                cGridEX.RootTable.Columns.Add();
                            }
                            cGridEX.RootTable.Columns[y].DataMember   = obe.myDT.Columns[i].ColumnName;
                            cGridEX.RootTable.Columns[y].Key          = obe.myDT.Columns[i].ColumnName;
                            cGridEX.RootTable.Columns[y].AutoSizeMode = ColumnAutoSizeMode.AllCellsAndHeader;

                            if (obe.myDT.Columns[i].DataType == System.Type.GetType("System.Boolean"))
                            {
                                cGridEX.RootTable.Columns[y].ColumnType = ColumnType.CheckBox;
                                cGridEX.RootTable.Columns[y].EditType   = EditType.CheckBox;
                            }
                            if (TblName == "AccountType")
                            {
                                switch (i)
                                {
                                case 1:
                                    cGridEX.RootTable.Columns[y].Caption = "Code";
                                    break;

                                case 2:
                                    cGridEX.RootTable.Columns[y].Caption = "Desc Eng";
                                    break;

                                case 3:
                                    cGridEX.RootTable.Columns[y].Caption = "Desc Fre";
                                    break;

                                default:
                                    cGridEX.RootTable.Columns[y].Caption = obe.myDT.Columns[i].ColumnName;
                                    break;
                                }
                            }
                            else
                            {
                                cGridEX.RootTable.Columns[y].Caption = obe.myDT.Columns[i].ColumnName;
                                if (obe.myDT.Columns[i].ColumnName == "WFBGColor")
                                {
                                    cGridEX.RootTable.Columns[y].Selectable = false;
                                    uiPanel2.Closed = false;
                                    cGridEX.RootTable.Columns.Add("BGColor");
                                }
                            }
                            y++;
                        }
                    }
                    cGridEX.RootTable.SortKeys.Add(cGridEX.RootTable.Columns[0], Janus.Windows.GridEX.SortOrder.Ascending);

                    if (cGridEX.RootTable.Columns.Contains("Obsolete"))
                    {
                        Janus.Windows.GridEX.GridEXFormatCondition gfc2 = new GridEXFormatCondition(cGridEX.RootTable.Columns["Obsolete"], ConditionOperator.Equal, true);
                        Janus.Windows.GridEX.GridEXFormatStyle     gfs2 = new GridEXFormatStyle();
                        gfs2.FontStrikeout = TriState.True;
                        gfc2.FormatStyle   = gfs2;
                        cGridEX.RootTable.FormatConditions.Add(gfc2);
                    }
                    if (cGridEX.RootTable.Columns.Contains("ReadOnly"))
                    {
                        Janus.Windows.GridEX.GridEXFormatCondition gfc = new GridEXFormatCondition(cGridEX.RootTable.Columns["ReadOnly"], ConditionOperator.Equal, true);
                        Janus.Windows.GridEX.GridEXFormatStyle     gfs = new GridEXFormatStyle();
                        gfs.BackColor   = Color.Gainsboro;
                        gfs.ForeColor   = SystemColors.ControlDarkDark;
                        gfc.FormatStyle = gfs;
                        cGridEX.RootTable.FormatConditions.Add(gfc);
                    }
                    cGridEX.AutoSizeColumns();
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }