Ejemplo n.º 1
0
        public List <Row_in_kart_defect> SaveInKartDefect()
        {
            id = MainOUP.GetIndexOfKartDefect(save_row.Nom_sz);
            List <Row_in_kart_defect> result = new List <Row_in_kart_defect>();

            foreach (SlugebZapiskaIzgotViewModal row in izgot)
            {
                if (row.Save != null)
                {
                    if (row.Save.Nom_sz == null)
                    {
                        row.Save.Nom_sz = save_row.Nom_sz;
                        row.Save.Par    = id;
                    }
                    result.Add(row.Save);
                }
            }
            foreach (SlugebZapiskaRemontViewModal row in remont)
            {
                if (row.Save != null)
                {
                    if (row.Save.Nom_sz == null)
                    {
                        row.Save.Nom_sz = save_row.Nom_sz;
                        row.Save.Par    = id;
                    }
                    result.Add(row.Save);
                }
            }
            foreach (SlugebZapiskaPriobrViewModal row in priobr)
            {
                if (row.Save != null)
                {
                    if (row.Save.Nom_sz == null)
                    {
                        row.Save.Nom_sz = save_row.Nom_sz;
                        row.Save.Par    = id;
                    }
                    result.Add(row.Save);
                }
            }
            foreach (SlugebZapiskaStorRemViewModal row in stor_rem)
            {
                if (row.Save != null)
                {
                    if (row.Save.Nom_sz == null)
                    {
                        row.Save.Nom_sz = save_row.Nom_sz;
                        row.Save.Par    = id;
                    }
                    result.Add(row.Save);
                }
            }
            is_change = false;
            return(result);
        }
Ejemplo n.º 2
0
 public Tree_defect(string pNom_sz)
 {
     InitializeComponent();
     Nom_sz = pNom_sz;
     id     = MainOUP.GetIndexOfKartDefect(Nom_sz);
     Modal  = new ObservableCollection <TreeViewModal>();
     Modal.Add(LoadTreeFromServer(id));
     Server.GetServer.DataBase("uit").InitStalker(Dispatcher.CurrentDispatcher, this);
     treeView.ItemsSource = Modal;
 }
Ejemplo n.º 3
0
        public SlugebZapiskaViewModal(string pnom_sz)
        {
            save_row = (Server.GetServer.DataBase("uit").Table("select * from rz_plan_rabot where nom_sz = '"
                                                               + pnom_sz + "'").LoadFromServer() as List <Row_in_plan_rabot>)[0];
            id = MainOUP.GetIndexOfKartDefect(pnom_sz);
            text_for_filter_ser_nom  = save_row.Ser_nom;
            text_for_filter_kontract = save_row.Nom_kont;

            izgot = new ObservableCollection <SlugebZapiskaIzgotViewModal>();
            ObservableCollection <RowDefectViewModal> tmp_list = Converter.ToViewModal(Server.GetServer
                                                                                       .DataBase("uit").Table("select * from rz_kart_defect where par = " + id + " and spos_ustr = "
                                                                                                              + References.GetReferences.GetId("rz_spos_ustr", "Изготовить"))
                                                                                       .LoadFromServer() as List <Row_in_kart_defect>);

            foreach (RowDefectViewModal row in tmp_list)
            {
                izgot.Add(new SlugebZapiskaIzgotViewModal(row));
            }
            if (izgot.Count == 0)
            {
                izgot.Add(new SlugebZapiskaIzgotViewModal(id));
            }

            remont   = new ObservableCollection <SlugebZapiskaRemontViewModal>();
            tmp_list = Converter.ToViewModal(Server.GetServer.DataBase("uit")
                                             .Table("select * from rz_kart_defect where par = " + id + " and spos_ustr = "
                                                    + References.GetReferences.GetId("rz_spos_ustr", "Дефектация"))
                                             .LoadFromServer() as List <Row_in_kart_defect>);
            foreach (RowDefectViewModal row in tmp_list)
            {
                remont.Add(new SlugebZapiskaRemontViewModal(row));
            }
            if (remont.Count == 0)
            {
                remont.Add(new SlugebZapiskaRemontViewModal(id));
            }

            priobr   = new ObservableCollection <SlugebZapiskaPriobrViewModal>();
            tmp_list = Converter.ToViewModal(Server.GetServer.DataBase("uit")
                                             .Table("select * from rz_kart_defect where par = " + id + " and spos_ustr = "
                                                    + References.GetReferences.GetId("rz_spos_ustr", "Приобрести"))
                                             .LoadFromServer() as List <Row_in_kart_defect>);
            foreach (RowDefectViewModal row in tmp_list)
            {
                priobr.Add(new SlugebZapiskaPriobrViewModal(row));
            }
            if (priobr.Count == 0)
            {
                priobr.Add(new SlugebZapiskaPriobrViewModal(id));
            }

            stor_rem = new ObservableCollection <SlugebZapiskaStorRemViewModal>();
            tmp_list = Converter.ToViewModal(Server.GetServer.DataBase("uit")
                                             .Table("select * from rz_kart_defect where par = " + id + " and spos_ustr = "
                                                    + References.GetReferences.GetId("rz_spos_ustr", "Сторонний ремонт"))
                                             .LoadFromServer() as List <Row_in_kart_defect>);
            foreach (RowDefectViewModal row in tmp_list)
            {
                stor_rem.Add(new SlugebZapiskaStorRemViewModal(row));
            }
            if (stor_rem.Count == 0)
            {
                stor_rem.Add(new SlugebZapiskaStorRemViewModal(id));
            }

            DefaultAction();
        }
Ejemplo n.º 4
0
 public void InitStalker(Dispatcher pdis, MainOUP pMOUP)
 {
     dis  = pdis;
     MOUP = pMOUP;
     StalkerForPlan();
 }