Exemplo n.º 1
0
 void OpenCounterparty(object sender, EventArgs e)
 {
     TabParent.OpenTab(
         OrmMain.GenerateDialogHashName <Counterparty>(Entity.Counterparty.Id),
         () => new CounterpartyDlg(Entity.Counterparty.Id)
         );
 }
Exemplo n.º 2
0
        protected void OnButtonOpenCarClicked(object sender, EventArgs e)
        {
            var selected = ytreeviewAtWorkDrivers.GetSelectedObjects <AtWorkDriver>();

            TabParent.OpenTab(OrmMain.GenerateDialogHashName <Car>(selected[0].Car.Id),
                              () => new CarsDlg(selected[0].Car)
                              );
        }
Exemplo n.º 3
0
        protected void OnButtonOpenDriverClicked(object sender, EventArgs e)
        {
            var selected = ytreeviewAtWorkDrivers.GetSelectedObjects <AtWorkDriver>();

            foreach (var one in selected)
            {
                TabParent.OpenTab(OrmMain.GenerateDialogHashName <Employee>(one.Employee.Id),
                                  () => new EmployeeDlg(one.Employee.Id)
                                  );
            }
        }
Exemplo n.º 4
0
        protected void OnButtonOpenKeepingClicked(object sender, EventArgs e)
        {
            var selectedDrivers = yTreeViewDrivers.GetSelectedObjects <WorkingDriverVMNode> ();

            foreach (var driver in selectedDrivers)
            {
                foreach (var routeId in driver.RouteListsIds.Select(x => x.Key))
                {
                    MainClass.MainWin.TdiMain.OpenTab(
                        OrmMain.GenerateDialogHashName <RouteList> (routeId),
                        () => new RouteListKeepingDlg(routeId)
                        );
                }
            }
        }
Exemplo n.º 5
0
        void YentryreferenceRLTo_Changed(object sender, EventArgs e)
        {
            if (yentryreferenceRLTo.Subject == null)
            {
                ytreeviewRLTo.ItemsDataSource = null;
                return;
            }

            RouteList routeListTo   = yentryreferenceRLTo.Subject as RouteList;
            RouteList routeListFrom = yentryreferenceRLFrom.Subject as RouteList;

            if (DomainHelper.EqualDomainObjects(routeListFrom, routeListTo))
            {
                yentryreferenceRLTo.Subject = null;
                MessageDialogWorks.RunErrorDialog("Вы дурачёк?", "Вы не можете передавать адреса в тот же МЛ, из которого забираете.");
                return;
            }

            if (TabParent != null)
            {
                var tab = TabParent.FindTab(OrmMain.GenerateDialogHashName <RouteList> (routeListTo.Id));
                if (!(tab is RouteListClosingDlg))
                {
                    if (tab != null)
                    {
                        MessageDialogWorks.RunErrorDialog("Маршрутный лист уже открыт в другой вкладке");
                        yentryreferenceRLTo.Subject = null;
                        return;
                    }
                }
            }

            CheckSensitivities();

            routeListTo.UoW = uow;

            IList <RouteListItemNode> items = new List <RouteListItemNode>();

            foreach (var item in routeListTo.Addresses)
            {
                items.Add(new RouteListItemNode {
                    RouteListItem = item
                });
            }
            ytreeviewRLTo.ItemsDataSource = items;
        }
Exemplo n.º 6
0
        protected void OnButtonChangeToEmployeeClicked(object sender, EventArgs e)
        {
            if (UoW.HasChanges || Entity.Id == 0)
            {
                if (!MessageDialogWorks.RunQuestionDialog("Для продолжения необходимо сохранить изменения, сохранить и продолжить?"))
                {
                    return;
                }
                if (Save())
                {
                    OnEntitySaved(true);
                }
                else
                {
                    return;
                }
            }
            var employeeUow = UnitOfWorkFactory.CreateWithNewRoot <Employee>();

            Personnel.ChangeTraineeToEmployee(employeeUow, Entity);
            TabParent.OpenTab(OrmMain.GenerateDialogHashName <Employee>(Entity.Id),
                              () => new EmployeeDlg(employeeUow));
            this.OnCloseTab(false);
        }
Exemplo n.º 7
0
 protected void OnButtonCreateTemplateClicked(object sender, EventArgs e)
 {
     TabParent.OpenTab(OrmMain.GenerateDialogHashName <CommentsTemplates>(0),
                       () => new CommentDlg(), this
                       );
 }