예제 #1
0
 public loginModelView()
 {
     login = new CommandPar((p) => {
         var passwordBox = p as PasswordBox;
         var password    = passwordBox.Password;
         var user        = Ico.getValue <db>().GetUnivdb().users.ToList().Where(u => u.username.Equals(username) && u.passoword.Equals(password)).ToList().FirstOrDefault();
         if (user == null)
         {
             erour = Visibility.Visible;
         }
         else
         {
             erour = Visibility.Collapsed;
             Ico.ResetValue <user>(user);
             MainWindow main = new MainWindow();
             main.Show();
             App.Current.MainWindow.Close();
             App.Current.MainWindow = main;
             Ico.getValue <ContentApp>().OpenSample4Dialog();
             Ico.getValue <ContentApp>().Sample4Content = new Messagebox(new List <string> {
                 "أهلا وسهلا بك  يا " + user.name
             }, Ico.getValue <ContentApp>().CancelSample4Dialog, true);
         }
     });
 }
예제 #2
0
        public ViewClientViewModel()
        {
            Clients = new ObservableCollection <ClientPartViewModel>(Ico.getValue <db>().GetUnivdb().clients.ToList().Select(c => new ClientPartViewModel(c)
            {
                deleteAc = (t) => {
                    Clients.Remove(t as ClientPartViewModel);
                },
                editAc = () =>
                {
                    Ico.getValue <ContentApp>().page = new EditClient(c);
                }
            }));
            new_ = new Command(() => {
                Ico.getValue <ContentApp>().page = new AddCLient();
            });
            Serech = new CommandPar((t) => {
                var text = (string)t;
                Clients  = new ObservableCollection <ClientPartViewModel>(Ico.getValue <db>().GetUnivdb().clients.ToList().Select(c => new ClientPartViewModel(c)
                {
                    deleteAc = (tc) => {
                        Clients.Remove(tc as ClientPartViewModel);
                    },
                    editAc = () =>
                    {
                        Ico.getValue <ContentApp>().page = new EditClient(c);
                    }
                }

                                                                                                                                  ).Where((l) => l.Name.Contains(text) || l.numaccount.Contains(text) || l.bank.Contains(text))
                                                                          );
            });
        }
        public processesViewModel()
        {
            actionUP = () =>
            {
                this.processes = new ObservableCollection <processesViewMODEL>(Ico.getValue <db>().GetUnivdb().processes.ToList().Select(p => new processesViewMODEL(p)
                {
                    removeaction = () => {
                        Sample4Content = new YesOrNo("هل أنت مـأكد من قيامك بحذف هذه العملية  ؟ , لا يمكن التراجع عن هذه العملية ",
                                                     async() => {
                            AcceptSample4Dialog();
                            await Task.Run(() => {
                                Ico.getValue <db>().GetUnivdb().processes.Remove(Ico.getValue <db>().GetUnivdb().processes.ToList().Where(pro => pro.Id == p.Id).ToList().FirstOrDefault());

                                CancelSample4Dialog();
                            });
                        },
                                                     () => {
                            CancelSample4Dialog();
                        });
                    }
                }));
            };
            inTilData();
            Count  = processes.Count;
            Serech = new CommandPar((t) => {
                var text  = (string)t;
                processes = new ObservableCollection <processesViewMODEL>(Ico.getValue <db>().GetUnivdb().processes.ToList().Select(p => new processesViewMODEL(p)).Where((l) => l.Code.Contains(text) || l.Name.Contains(text)));
            });
            new_ = new Command(() => {
                //      MainViewModel.page = new NewProcesses();
                Ico.getValue <ContentApp>().page = new NewProcesses();
            });
        }
예제 #4
0
 public loginModelView()
 {
     login = new CommandPar((p) => {
         var passwordBox = p as PasswordBox;
         var password    = passwordBox.Password;
         MessageBox.Show(password);
     });
 }
 public processesViewModel()
 {
     this.processes = new ObservableCollection <processesViewMODEL>(Ico.getValue <db>().GetUnivdb().processes.ToList().Select(p => new processesViewMODEL(p)));
     Count          = processes.Count;
     Serech         = new CommandPar((t) => {
         var text  = (string)t;
         processes = new ObservableCollection <processesViewMODEL>(Ico.getValue <db>().GetUnivdb().processes.ToList().Select(p => new processesViewMODEL(p)).Where((l) => l.Code.Contains(text) || l.Name.Contains(text)));
     });
     new_ = new Command(() => {
         //      MainViewModel.page = new NewProcesses();
         Ico.getValue <ContentApp>().page = new NewProcesses();
     });
 }
예제 #6
0
        public ViewClientViewModel()
        {
            actionUP = () =>

            {
                val = new ObservableCollection <ClientPartViewModel>(Ico.getValue <db>().GetUnivdb().clients.ToList().Select(c => new ClientPartViewModel(c)
                {
                    deleteAc = (t) =>
                    {
                        Ico.getValue <ContentApp>().OpenSample4Dialog();
                        Ico.getValue <ContentApp>().Sample4Content = new YesOrNo("هل أنت متأكد من قيامك بحذف هذا العميل  ,لا يمكن التراجع عن الحذف",
                                                                                 async() => {
                            Ico.getValue <ContentApp>().AcceptSample4Dialog();
                            await Task.Run(() =>
                            {
                                Ico.getValue <db>().GetUnivdb().clients.Remove(
                                    Ico.getValue <db>().GetUnivdb().clients.ToList().Where(cl => cl.Id == c.Id).FirstOrDefault());
                                Ico.getValue <db>().savedb();
                                inTilData();
                            });
                            Ico.getValue <ContentApp>().CancelSample4Dialog();
                        }, Ico.getValue <ContentApp>().CancelSample4Dialog);
                    },
                    editAc = () =>
                    {
                        Ico.getValue <ContentApp>().page = new EditClient(c, inTilData);
                    }
                }));
                Clients = val;
            };
            actionUP();
            new_ = new Command(() => {
                Ico.getValue <ContentApp>().page = new AddCLient();
            });
            Serech = new CommandPar((t) => {
                var text = (string)t;
                Clients  = new ObservableCollection <ClientPartViewModel>(Ico.getValue <db>().GetUnivdb().clients.ToList().Select(c => new ClientPartViewModel(c)
                {
                    deleteAc = (tc) => {
                        Clients.Remove(tc as ClientPartViewModel);
                    },
                    editAc = () =>
                    {
                        Ico.getValue <ContentApp>().page = new EditClient(c);
                    }
                }

                                                                                                                                  ).Where((l) => l.Name.Contains(text) || l.numaccount.Contains(text) || l.bank.Contains(text))
                                                                          );
            });
        }
 public ClientPartViewModel(client client)
 {
     this.Name       = client.Name;
     this.numaccount = client.num_account;
     this.agence     = client.gence;
     this.bank       = client.bank;
     this.address    = client.address;
     delete          = new CommandPar((item) => {
         deleteAc(item);
     });
     edit = new Command(() => {
         editAc();
     });
 }
 public loginModelView()
 {
     login = new CommandPar((p) => {
         var passwordBox = p as PasswordBox;
         var password    = passwordBox.Password;
         var user        = Ico.getValue <db>().GetUnivdb().users.ToList().Where(u => u.username.Equals(username) && u.passoword.Equals(password)).ToList().FirstOrDefault();
         if (user == null)
         {
             erour = Visibility.Visible;
         }
         else
         {
             Ico.setValue <user>(user);
             MessageBox.Show("JL HG]O,G FK[HP ");
         }
     });
 }
        public ViewClientViewModel()
        {
            actionUP = () =>

            {
                val = new ObservableCollection <ClientPartViewModel>(Ico.getValue <db>().GetUnivdb().clients.ToList().Select(c => new ClientPartViewModel(c)
                {
                    deleteAc = (t) =>
                    {
                        Ico.getValue <db>().GetUnivdb().clients.Remove(
                            Ico.getValue <db>().GetUnivdb().clients.ToList().Where(cl => cl.Id == c.Id).FirstOrDefault());
                        Ico.getValue <db>().savedb();
                        inTilData();
                    },
                    editAc = () =>
                    {
                        Ico.getValue <ContentApp>().page = new EditClient(c);
                    }
                }));
                Clients = val;
            };
            actionUP();
            new_ = new Command(() => {
                Ico.getValue <ContentApp>().page = new AddCLient();
            });
            Serech = new CommandPar((t) => {
                var text = (string)t;
                Clients  = new ObservableCollection <ClientPartViewModel>(Ico.getValue <db>().GetUnivdb().clients.ToList().Select(c => new ClientPartViewModel(c)
                {
                    deleteAc = (tc) => {
                        Clients.Remove(tc as ClientPartViewModel);
                    },
                    editAc = () =>
                    {
                        Ico.getValue <ContentApp>().page = new EditClient(c);
                    }
                }

                                                                                                                                  ).Where((l) => l.Name.Contains(text) || l.numaccount.Contains(text) || l.bank.Contains(text))
                                                                          );
            });
        }
예제 #10
0
        public ClientPartViewModel(client client)
        {
            this.Name       = client.Name;
            this.numaccount = client.num_account;
            this.agence     = client.gence;
            this.bank       = client.bank;
            this.address    = client.address;
            var c = client.card_kanoni.ToList().Count;

            visibility = Visibility.Visible;
            if (c > 0)
            {
                visibility = Visibility.Collapsed;
            }
            delete = new CommandPar((item) => {
                deleteAc(item);
            });
            edit = new Command(() => {
                editAc();
            });
        }
예제 #11
0
        public processesViewModel()
        {
            actionUP = () =>
            {
                this.processes = new ObservableCollection <processesViewMODEL>(Ico.getValue <db>().GetUnivdb().processes.ToList().Select(p => new processesViewMODEL(p)
                {
                    removeaction = () => {
                        OpenSample4Dialog();

                        Sample4Content = new YesOrNo("هل أنت مـتأكد من قيامك بحذف هذه العملية  ؟ , لا يمكن التراجع عن هذه الحذف ",
                                                     async() => {
                            AcceptSample4Dialog();
                            await Task.Run(() => {
                                var ps = Ico.getValue <db>().GetUnivdb().processes.ToList().Where(pro => pro.Id == p.Id).ToList().FirstOrDefault();


                                foreach (var i in ps.cards.ToList())
                                {
                                    Ico.getValue <db>().GetUnivdb().card_7isab.AddRange(i.card_7isab);
                                }

                                foreach (var i in ps.cards.ToList())
                                {
                                    Ico.getValue <db>().GetUnivdb().card_kanoni.AddRange(i.card_kanoni);
                                }

                                foreach (var i in ps.cards.ToList())
                                {
                                    Ico.getValue <db>().GetUnivdb().card_mo7sabi.AddRange(i.card_mo7sabi);
                                }

                                foreach (var i in ps.cards.ToList())
                                {
                                    foreach (var ic in ps.parts.ToList())
                                    {
                                        Ico.getValue <db>().GetUnivdb().card_dafa3.RemoveRange(ic.card_dafa3);
                                        Ico.getValue <db>().GetUnivdb().p_sa7ab.RemoveRange(ic.p_sa7ab);
                                    }

                                    Ico.getValue <db>().GetUnivdb().card_sa7ab.AddRange(i.card_sa7ab);
                                }

                                Ico.getValue <db>().GetUnivdb().cards.RemoveRange(ps.cards);
                                Ico.getValue <db>().GetUnivdb().parts.RemoveRange(ps.parts);

                                Ico.getValue <db>().GetUnivdb().processes.Remove(ps);
                                Ico.getValue <db>().savedb();

                                CancelSample4Dialog();
                                inTilData();
                            });
                        },
                                                     () => {
                            CancelSample4Dialog();
                        });
                    }
                }));
            };
            inTilData();
            Count  = processes.Count;
            Serech = new CommandPar((t) => {
                var text  = (string)t;
                processes = new ObservableCollection <processesViewMODEL>(Ico.getValue <db>().GetUnivdb().processes.ToList().Select(p => new processesViewMODEL(p)
                {
                    removeaction = () => {
                        OpenSample4Dialog();

                        Sample4Content = new YesOrNo("هل أنت مـنأكد من قيامك بحذف هذه العملية  ؟ , لا يمكن التراجع عن هذه الحذف ",

                                                     async() => {
                            AcceptSample4Dialog();

                            await Task.Run(() => {
                                Ico.getValue <db>().GetUnivdb().processes.Remove(Ico.getValue <db>().GetUnivdb().processes.ToList().Where(pro => pro.Id == p.Id).ToList().FirstOrDefault());
                                Ico.getValue <db>().savedb();
                                CancelSample4Dialog();
                                inTilData();
                            });
                        },
                                                     () => {
                            CancelSample4Dialog();
                        });
                    }
                }

                                                                                                                                    ).Where((l) => l.Code.Contains(text) || l.Name.Contains(text))
                                                                          );
            });
            new_ = new Command(() => {
                //      MainViewModel.page = new NewProcesses();
                Ico.getValue <ContentApp>().page = new NewProcesses();
            });
        }