Ejemplo n.º 1
0
 public static void _SA_Open(PROJECT ProjectRecord)
 {
     if (!ProjectLedger.repo.SelfInfo.Exists())
     {
         ProjectLedger._SA_Invoke();
     }
     ProjectLedger.repo.SelectRecord.Select(ProjectRecord.name);
 }
Ejemplo n.º 2
0
        public static void _SA_Delete(PROJECT ProjectRecord)
        {
            if (!ProjectLedger.repo.SelfInfo.Exists())
            {
                ProjectLedger._SA_Invoke();
            }

            if (ProjectLedger.repo.SelectRecord.SelectedItemText != ProjectRecord.name)
            {
                ProjectLedger._SA_Open(ProjectRecord);
            }

            //ProjectLedger.repo.ClickRemove(); // remove method to be updated

            //SimplyMessage.Instance._SA_HandleMessage(SimplyMessage.YES_LOC, SimplyMessage._MSG_AREYOUSUREYOUWANTTOREMOVE_LOC, true);
        }
Ejemplo n.º 3
0
        public static void _SA_Create(PROJECT ProjectRecord, bool bSave, bool bEdit)
        {
            if (!Variables.bUseDataFiles && !bEdit)
            {
                ProjectLedger._SA_MatchDefaults(ProjectRecord);
            }

            if (!ProjectLedger.repo.SelfInfo.Exists())
            {
                ProjectLedger._SA_Invoke();
            }

            if (bEdit)
            {
                if (ProjectLedger.repo.SelectRecord.SelectedItemText != ProjectRecord.name)
                {
                    ProjectLedger._SA_Open(ProjectRecord);
                }

                if (Functions.GoodData(ProjectRecord.nameEdit))
                {
                    ProjectLedger.repo.Project.ProjectName.TextValue = ProjectRecord.nameEdit;
                    ProjectRecord.name = ProjectRecord.nameEdit;
                }

                // print to log or results
                Ranorex.Report.Info(String.Format("Modifying project {0}", ProjectRecord.name));
            }
            else
            {
                ProjectLedger.repo.CreateANewToolButton.Click();
                ProjectLedger.repo.Project.ProjectName.TextValue = ProjectRecord.name;
                Ranorex.Report.Info(String.Format("Creating project {0}", ProjectRecord.name));
            }

            // Project tab
            ProjectLedger.repo.Project.Tab.Click();
            if (Functions.GoodData(ProjectRecord.startDate))
            {
                ProjectLedger.repo.Project.StartDate.TextValue = ProjectRecord.startDate;
            }

            if (Functions.GoodData(ProjectRecord.endDate))
            {
                ProjectLedger.repo.Project.EndDate.TextValue = ProjectRecord.endDate;
            }

            if (Functions.GoodData(ProjectRecord.revenue))
            {
                ProjectLedger.repo.Project.Revenue.TextValue = ProjectRecord.revenue;
            }

            if (Functions.GoodData(ProjectRecord.expense))
            {
                ProjectLedger.repo.Project.Expense.TextValue = ProjectRecord.expense;
            }

            if (ProjectRecord.status != 0)
            {
                ProjectLedger.repo.Project.Status.Items[((int)ProjectRecord.status)].Select();
            }

            if (Functions.GoodData(ProjectRecord.inactiveCheckBox))
            {
                ProjectLedger.repo.InactiveProject.SetState(ProjectRecord.inactiveCheckBox);
            }

            // check if budget tab exists, will take a long time since object times are acccumalitive
            if (ProjectLedger.repo.Budget.TabInfo.Exists())
            {
                ProjectLedger.repo.Budget.Tab.Click();

                if (Functions.GoodData(ProjectRecord.budgetCheckBox))
                {
                    ProjectLedger.repo.Budget.BudgetThisProject.SetState(ProjectRecord.budgetCheckBox);

                    // Budget details
                    if (ProjectLedger.repo.Budget.BudgetThisProject.Enabled)
                    {
                        int BUDGET_REVENUE_COLUMN  = 2;
                        int BUDGET_EXPENSES_COLUMN = 3;

                        ProjectLedger.repo.Budget.BudgetContainer.ClickFirstCell();

                        for (int x = 0; x < ProjectRecord.Budgets.Count; x++)
                        {
                            if (Functions.GoodData(ProjectRecord.Budgets[x].revenue))
                            {
                                ProjectLedger.repo.Budget.BudgetContainer.MoveToField(x, BUDGET_REVENUE_COLUMN);
                                ProjectLedger.repo.Budget.BudgetContainer.SetText(ProjectRecord.Budgets[x].revenue);
                            }

                            if (Functions.GoodData(ProjectRecord.Budgets[x].expense))
                            {
                                ProjectLedger.repo.Budget.BudgetContainer.MoveToField(x, BUDGET_EXPENSES_COLUMN);
                                ProjectLedger.repo.Budget.BudgetContainer.SetText(ProjectRecord.Budgets[x].expense);
                            }
                        }
                    }
                }
            }


            // Additional info
            ProjectLedger.repo.AdditionalInfo.Tab.Click();

            if (ProjectLedger.repo.AdditionalInfo.Additional1Info.Exists())
            {
                if (Functions.GoodData(ProjectRecord.additional1))
                {
                    ProjectLedger.repo.AdditionalInfo.Additional1.TextValue = ProjectRecord.additional1;
                }

                if (Functions.GoodData(ProjectRecord.addCheckBox1))
                {
                    ProjectLedger.repo.AdditionalInfo.AddCheckBox1.SetState(ProjectRecord.addCheckBox1);
                }
            }

            if (ProjectLedger.repo.AdditionalInfo.Additional2Info.Exists())
            {
                if (Functions.GoodData(ProjectRecord.additional2))
                {
                    ProjectLedger.repo.AdditionalInfo.Additional2.TextValue = ProjectRecord.additional2;
                }

                if (Functions.GoodData(ProjectRecord.addCheckBox2))
                {
                    ProjectLedger.repo.AdditionalInfo.AddCheckBox2.SetState(ProjectRecord.addCheckBox2);
                }
            }

            if (ProjectLedger.repo.AdditionalInfo.Additional3Info.Exists())
            {
                if (Functions.GoodData(ProjectRecord.additional3))
                {
                    ProjectLedger.repo.AdditionalInfo.Additional3.TextValue = ProjectRecord.additional3;
                }

                if (Functions.GoodData(ProjectRecord.addCheckBox3))
                {
                    ProjectLedger.repo.AdditionalInfo.AddCheckBox3.SetState(ProjectRecord.addCheckBox3);
                }
            }

            if (ProjectLedger.repo.AdditionalInfo.Additional4Info.Exists())
            {
                if (Functions.GoodData(ProjectRecord.additional4))
                {
                    ProjectLedger.repo.AdditionalInfo.Additional4.TextValue = ProjectRecord.additional4;
                }

                if (Functions.GoodData(ProjectRecord.addCheckBox4))
                {
                    ProjectLedger.repo.AdditionalInfo.AddCheckBox2.SetState(ProjectRecord.addCheckBox4);
                }
            }

            if (ProjectLedger.repo.AdditionalInfo.Additional5Info.Exists())
            {
                if (Functions.GoodData(ProjectRecord.additional5))
                {
                    ProjectLedger.repo.AdditionalInfo.Additional5.TextValue = ProjectRecord.additional5;
                }

                if (Functions.GoodData(ProjectRecord.addCheckBox5))
                {
                    ProjectLedger.repo.AdditionalInfo.AddCheckBox2.SetState(ProjectRecord.addCheckBox5);
                }
            }

            if (bSave)
            {
                ProjectLedger.repo.Save.Click();
            }
        }
Ejemplo n.º 4
0
        // need to add repository first
        // public static ProjectLedgerResFolders

        public static void _SA_Invoke()
        {
            ProjectLedger._SA_Invoke(true);
        }