Exemple #1
0
        private void CreateTaskFromTask()
        {
            var cwCreateTask = new CWCreateTaskFromTask(api);

#if !SILVERLIGHT
            cwCreateTask.DialogTableId = 2000000105;
#endif
            cwCreateTask.Closed += async delegate
            {
                if (cwCreateTask.DialogResult == true)
                {
                    var       projLst   = dgProjectGrid.GetVisibleRows() as IList <Uniconta.DataModel.Project>;
                    BudgetAPI budgetApi = new BudgetAPI(api);
                    var       result    = await budgetApi.CreateTaskFromTask(CWCreateTaskFromTask.FromPrWorkSpace, CWCreateTaskFromTask.ToPrWorkSpace, CWCreateTaskFromTask.ProjectTemplate, CWCreateTaskFromTask.AddYear, projLst);

                    if (result != ErrorCodes.Succes)
                    {
                        UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
                        UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Tasks"), " ", Uniconta.ClientTools.Localization.lookup("Created").ToLower()),
                                                Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    }
                }
            };
            cwCreateTask.Show();
        }
Exemple #2
0
        private void UpdatePrices()
        {
            var cwUpdateBjt = new CwCreateUpdateBudget(api, 1);

#if !SILVERLIGHT
            cwUpdateBjt.DialogTableId = 2000000178;
#endif
            cwUpdateBjt.Closed += async delegate
            {
                if (cwUpdateBjt.DialogResult == true)
                {
                    var projLst = dgProjectGrid.GetVisibleRows() as IList <Uniconta.DataModel.Project>;

                    BudgetAPI budgetApi = new BudgetAPI(api);
                    var       result    = await budgetApi.UpdatePrices(CwCreateUpdateBudget.FromDate, CwCreateUpdateBudget.ToDate, CwCreateUpdateBudget.Employee, CwCreateUpdateBudget.Payroll,
                                                                       CwCreateUpdateBudget.PrCategory, CwCreateUpdateBudget.Group, CwCreateUpdateBudget.PrWorkSpace, cwUpdateBjt.InclProjectTask, projLst);

                    if (result != ErrorCodes.Succes)
                    {
                        UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
                        UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Prices"), " ", Uniconta.ClientTools.Localization.lookup("Updated").ToLower()),
                                                Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    }
                }
            };
            cwUpdateBjt.Show();
        }
Exemple #3
0
        private void CreateBudgetTask()
        {
            var cwCreateBjtTask = new CwCreateBudgetTask(api, 0);

#if !SILVERLIGHT
            cwCreateBjtTask.DialogTableId = 2000000179;
#endif
            cwCreateBjtTask.Closed += async delegate
            {
                if (cwCreateBjtTask.DialogResult == true)
                {
                    var projLst = dgProjectGrid.GetVisibleRows() as IList <Uniconta.DataModel.Project>;

                    BudgetAPI budgetApi = new BudgetAPI(api);
                    var       result    = await budgetApi.CreateBudgetTask(CwCreateBudgetTask.Employee, CwCreateBudgetTask.Payroll, CwCreateBudgetTask.Group,
                                                                           CwCreateBudgetTask.PrWorkSpace, cwCreateBjtTask.DeleteBudget, CwCreateBudgetTask.BudgetTaskPrincip,
                                                                           CwCreateBudgetTask.TaskHours, projLst);

                    if (result != ErrorCodes.Succes)
                    {
                        UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
                        UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Budget"), " ", Uniconta.ClientTools.Localization.lookup("Created").ToLower()),
                                                Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    }
                }
            };
            cwCreateBjtTask.Show();
        }
        private void CreateTaskFromTask()
        {
            var cwCreateTask = new CWCreateTaskFromTask(api, proj?._Number);

            cwCreateTask.DialogTableId = 2000000104;
            cwCreateTask.Closed       += async delegate
            {
                if (cwCreateTask.DialogResult == true)
                {
                    var taskLst = (IEnumerable <Uniconta.DataModel.ProjectTask>)dgProjectTaskGrid.GetVisibleRows();

                    BudgetAPI budgetApi = new BudgetAPI(api);
                    var       result    = await budgetApi.CreateTaskFromTask(CWCreateTaskFromTask.FromPrWorkSpace, CWCreateTaskFromTask.ToPrWorkSpace, cwCreateTask.ToProject, cwCreateTask.BudgetTaskDatePrincip, cwCreateTask.NewDate, CWCreateTaskFromTask.AddYear, taskLst);

                    if (result != ErrorCodes.Succes)
                    {
                        UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
                        UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Tasks"), " ", Uniconta.ClientTools.Localization.lookup("Created").ToLower()),
                                                Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    }
                }
            };
            cwCreateTask.Show();
        }
        private void CreateAnchorBudget()
        {
            var cwCreateAnchorBjt = new CwCreateAnchorBudget(api);

#if !SILVERLIGHT
            cwCreateAnchorBjt.DialogTableId = 2000000102;
#endif
            cwCreateAnchorBjt.Closed += async delegate
            {
                if (cwCreateAnchorBjt.DialogResult == true)
                {
                    BudgetAPI budgetApi = new BudgetAPI(api);
                    var       result    = await budgetApi.CreateAnchorBudget(CwCreateAnchorBudget.Group);

                    if (result != ErrorCodes.Succes)
                    {
                        UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
                        UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("AnchorBudget"), " ", Uniconta.ClientTools.Localization.lookup("Updated").ToLower()),
                                                Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    }
                }
            };
            cwCreateAnchorBjt.Show();
        }
        private void CreateBudget()
        {
            var cwCreateBjt = new CwCreateUpdateBudget(api);

#if !SILVERLIGHT
            cwCreateBjt.DialogTableId = 2000000100;
#endif
            cwCreateBjt.Closed += async delegate
            {
                if (cwCreateBjt.DialogResult == true)
                {
                    BudgetAPI budgetApi = new BudgetAPI(api);
                    var       result    = await budgetApi.CreateBudget(CwCreateUpdateBudget.FromDate, CwCreateUpdateBudget.ToDate, CwCreateUpdateBudget.Employee, CwCreateUpdateBudget.Payroll,
                                                                       CwCreateUpdateBudget.PrCategory, CwCreateUpdateBudget.Group, CwCreateUpdateBudget.BudgetMethod, CwCreateUpdateBudget.BudgetName,
                                                                       CwCreateUpdateBudget.PrWorkSpace, cwCreateBjt.DeleteBudget, cwCreateBjt.InclProjectTask, null);

                    if (result != ErrorCodes.Succes)
                    {
                        UtilDisplay.ShowErrorCode(result);
                    }
                    else
                    {
                        UnicontaMessageBox.Show(string.Concat(Uniconta.ClientTools.Localization.lookup("Budget"), " ", Uniconta.ClientTools.Localization.lookup("Created").ToLower()),
                                                Uniconta.ClientTools.Localization.lookup("Information"), MessageBoxButton.OK);
                    }
                }
            };
            cwCreateBjt.Show();
        }