public void inTilData(process process) { this.process = process; var cl = Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().ToList().LastOrDefault(); if (cl != null) { this.oldcost = cl.old_cost; } else { this.oldcost = process.NewCost; this.newcost = process.NewCost; } Itemsa7abs = new ObservableCollection <Itemsa7ab>(Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => c.card.id_prosess == process.Id).ToList().Select(c => new Itemsa7ab(c) { start = () => { AcceptSample4Dialog(); AcceptSample4Dialog(); }, end = CancelSample4Dialog, addtashira = (t) => { Sample4Content = new Addtashira_sa7ab(t, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); }, edittashiraaction = (t) => { Sample4Content = new Edittashira_sa7ab(t, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); } })); addmo7asabi = new Command(() => { /* MessageBox.Show((process.cards.ToList().LastOrDefault() != null)+""); * MessageBox.Show((Ico.getValue<Date>().GetPevDate() != null )+""); * MessageBox.Show((process.cards.ToList().LastOrDefault().year1.Id != Ico.getValue<Date>().GetPevDate().Id) + ""); * MessageBox.Show((Ico.getValue<db>().GetUnivdb().card_sa7ab.ToList().Where(c => (c.card.id_prosess == process.Id) && * (c.card.year1.Id == Ico.getValue<Date>().GetNowDate().Id)).ToList().Count != 0) + ""); */ if ((Ico.getValue <Date>().GetPevDate() == null) || (process.cards.ToList().LastOrDefault() != null && Ico.getValue <Date>().GetPevDate() != null && process.cards.ToList().LastOrDefault().year1.Id != Ico.getValue <Date>().GetPevDate().Id&&Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => (c.card.id_prosess == process.Id) && (c.card.year1.Id == Ico.getValue <Date>().GetNowDate().Id)).ToList().Count != 0)) { MessageBox.Show("لا تستطيغ إستخراج باقة سحب بعد"); } else { Sample4Content = new Addsa7ab(process, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); } }); }
public void inTilData() { actionUP(); this.process = val; this.newcost = val.NewCost; Itemsa7abs = new ObservableCollection <Itemsa7ab>(Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => c.card.id_prosess == process.Id).ToList().Select(c => new Itemsa7ab(c) { Viewsa7abViewModel = this, start = () => { AcceptSample4Dialog(); AcceptSample4Dialog(); }, end = CancelSample4Dialog, addtashira = (t) => { Sample4Content = new Addtashira_sa7ab(t, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); }, edittashiraaction = (t) => { Sample4Content = new Edittashira_sa7ab(t, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); } })); addmo7asabi = new Command(() => { /* MessageBox.Show((process.cards.ToList().LastOrDefault() != null)+""); * MessageBox.Show((Ico.getValue<Date>().GetPevDate() != null )+""); * MessageBox.Show((process.cards.ToList().LastOrDefault().year1.Id != Ico.getValue<Date>().GetPevDate().Id) + ""); * MessageBox.Show((Ico.getValue<db>().GetUnivdb().card_sa7ab.ToList().Where(c => (c.card.id_prosess == process.Id) && * (c.card.year1.Id == Ico.getValue<Date>().GetNowDate().Id)).ToList().Count != 0) + ""); */ if ((process.date.Year == Ico.getValue <Date>().GetNowDate().year1.Year) || (Ico.getValue <Date>().GetPevDate() == null) || (process.cards.ToList().LastOrDefault() != null && Ico.getValue <Date>().GetPevDate() != null && process.cards.ToList().LastOrDefault().year1.Id != Ico.getValue <Date>().GetPevDate().Id&&Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => (c.card.id_prosess == process.Id) && (c.card.year1.Id == Ico.getValue <Date>().GetNowDate().Id)).ToList().Count != 0)) { Sample4Content = new Messagebox(new List <string>() { "لا تستطيغ إستخراج بطاقة سحب بعد" }, CancelSample4Dialog); OpenSample4Dialog(); } else { Sample4Content = new Addsa7ab(process, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); } }); }
public void inTilData(process process) { this.process = process; var cl = Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().ToList().LastOrDefault(); if (cl != null) { this.oldcost = cl.old_cost; } else { this.oldcost = process.NewCost; this.newcost = process.NewCost; } Itemsa7abs = new ObservableCollection <Itemsa7ab>(Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => c.card.id_prosess == process.Id).ToList().Select(c => new Itemsa7ab(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().processes.ToList().Where(N => N.Id == process.Id).ToList().SingleOrDefault()); }, edittashiraaction = (t) => { //Sample4Content = new Edittashira_mo7asabi(t, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); } })); addmo7asabi = new Command(() => { // if (Ico.getValue<Date>().GetPevDate() != null && process.cards.ToList().LastOrDefault().year1.Id== Ico.getValue<Date>().GetPevDate().Id MessageBox.Show(Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => c.card.id_prosess == process.Id && c.card.year1.Id == Ico.getValue <Date>().GetNowDate().Id).ToList().Count + ""); if (Ico.getValue <db>().GetUnivdb().card_sa7ab.ToList().Where(c => c.card.id_prosess == process.Id && c.card.year1.Id == Ico.getValue <Date>().GetNowDate().Id).ToList().Count == 0) { Sample4Content = new Addsa7ab(process, AcceptSample4Dialog, CancelSample4Dialog); OpenSample4Dialog(); } }); }