Beispiel #1
0
        public void inTilData(card_kanoni card_kanoni)
        {
            this.process  = card_kanoni.card.process;
            this.part     = new Part(card_kanoni.part);
            this.client   = card_kanoni.client.Name;
            this.newcost  = card_kanoni.part.process.NewCost;
            ItemMo7asabis = new ObservableCollection <ItemMo7asabi>(card_kanoni.part.card_mo7sabi.Select(c => new ItemMo7asabi(c)
            {
                action_edit = (t) => {
                    Sample4Content = new Editmo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                },
                start = () => { AcceptSample4Dialog();
                                AcceptSample4Dialog(); },
                end        = CancelSample4Dialog,
                addtashira = (t) => {
                    Sample4Content = new Addtashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                    this.inTilData(Ico.getValue <db>().GetUnivdb().card_kanoni.ToList().Where(N => N.id == card_kanoni.id).ToList().SingleOrDefault());
                },
                edittashiraaction = (t) => {
                    Sample4Content = new Edittashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                }
            }));

            addmo7asabi = new Command(() => {
                Sample4Content = new Addmo7asabi(card_kanoni, AcceptSample4Dialog, CancelSample4Dialog);
                OpenSample4Dialog();
            });
        }
        public void inTilData()
        {
            this.UpDate();
            this.process  = val.card.process;
            this.part     = new Part(val.part);
            this.client   = val.client.Name;
            this.newcost  = val.part.process.NewCost;
            ItemMo7asabis = new ObservableCollection <ItemMo7asabi>(val.part.card_mo7sabi.Select(c => new ItemMo7asabi(c)
            {
                action_edit = (t) => {
                    Sample4Content = new Editmo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                },
                start = () => { AcceptSample4Dialog();
                                AcceptSample4Dialog(); },
                end        = CancelSample4Dialog,
                addtashira = (t) => {
                    Sample4Content = new Addtashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                    this.inTilData();
                },
                edittashiraaction = (t) => {
                    Sample4Content = new Edittashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                }
            }));

            addmo7asabi = new Command(() => {
                var card = Ico.getValue <db>().GetUnivdb().card_mo7sabi.ToList().Where(c => c.id_part == card_kanoni.id_part).ToList().FirstOrDefault();
                var dn   = 0.0;
                foreach (var p in Ico.getValue <db>().GetUnivdb().parts.ToList().Where(pr => pr.Id_Pro == pr.Id_Pro).ToList())
                {
                    dn += p.mcost - p.nowcost;
                }

                if (card != null && card.card.year != Ico.getValue <Date>().GetNowDate()?.Id&& Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c =>
                                                                                                                                                         c.card.id_prosess == card_kanoni.card.id_prosess && c.card.year == Ico.getValue <Date>().GetNowDate().Id).ToList().ToList().Count == 0 && dn != 0)
                {
                    MessageBox.Show(" الرجاء التأكد من إستخراج بظاقة سحب إلتزام مسبقاا  ");
                }
                else
                {
                    Sample4Content = new Addmo7asabi(card_kanoni, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                }
            });
        }
        public void inTilData(card_kanoni card_kanoni)
        {
            this.process  = card_kanoni.card.process;
            this.part     = new Part(card_kanoni.part);
            this.client   = card_kanoni.client.Name;
            this.newcost  = card_kanoni.part.process.NewCost;
            ItemMo7asabis = new ObservableCollection <ItemMo7asabi>(card_kanoni.part.card_mo7sabi.Select(c => new ItemMo7asabi(c)
            {
                action_edit = (t) => {
                    Sample4Content = new Editmo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                },
                start = () => { AcceptSample4Dialog();
                                AcceptSample4Dialog(); },
                end        = CancelSample4Dialog,
                addtashira = (t) => {
                    Sample4Content = new Addtashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                    this.inTilData(Ico.getValue <db>().GetUnivdb().card_kanoni.ToList().Where(N => N.id == card_kanoni.id).ToList().SingleOrDefault());
                },
                edittashiraaction = (t) => {
                    Sample4Content = new Edittashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                }
            }));

            addmo7asabi = new Command(() => {
                MessageBox.Show((card != null) + "");
                MessageBox.Show((card.card.year == Ico.getValue <Date>().GetPevDate()?.Id) + "");
                MessageBox.Show((Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c =>
                                                                                           c.card.id_prosess == card_kanoni.card.id_prosess).ToList().ToList().Count == 0) + "");

                var card = Ico.getValue <db>().GetUnivdb().card_mo7sabi.ToList().Where(c => c.id_part == card_kanoni.id_part).ToList().FirstOrDefault();

                if (card != null && card.card.year == Ico.getValue <Date>().GetPevDate()?.Id&& Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c =>
                                                                                                                                                         c.card.id_prosess == card_kanoni.card.id_prosess).ToList().ToList().Count == 0)
                {
                    MessageBox.Show(" الرجاء التأكد من إستخراج بظاقة سحب إلتزام مسبقاا  ");
                }
                else
                {
                    Sample4Content = new Addmo7asabi(card_kanoni, AcceptSample4Dialog, CancelSample4Dialog);
                    OpenSample4Dialog();
                }
            });
        }