Esempio n. 1
0
        public void DeleteItem()
        {
            ExceptionCatcher.ExceptionFinder(() => {
                using (SDB sdb = new SDB())
                {
                    var personel = new Personel {
                        PersonelID = personelEntity.PersonelID
                    };
                    DAL.DAL dal             = new DAL.DAL();
                    MessageBoxResult result = DXMessageBox.Show("Çalışan Silinecek Onaylıyor Musunuz?", "Uyarı", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, MessageBoxOptions.None);
                    switch (result)
                    {
                    case MessageBoxResult.Yes:
                        dal.DeleteRecordPer(personel);
                        MessageBox.Show("Personel Silindi!");
                        gridcontrol_personel.ItemsSource = null;
                        GetPersonelList();
                        break;

                    case MessageBoxResult.No:
                        break;
                    }
                }
            });
        }
Esempio n. 2
0
        public void Yetki()
        {
            ExceptionCatcher.ExceptionFinder(() => {
                List <UserPermisson> list = AuthenticateHelperr.Permisson(Convert.ToInt32(AuthenticateHelperr.LoginUser[0].PersonelRoleID));

                foreach (var item in list)
                {
                    if (item.CompenetName == "navBar_uruntanim")
                    {
                        navBar_uruntanim.IsEnabled = item.EnabledState;
                    }
                    if (item.CompenetName == "navBar_raporList")
                    {
                        navBar_raporList.IsEnabled = item.EnabledState;
                    }
                    if (item.CompenetName == "navBar_personeltanim")
                    {
                        navBar_personeltanim.IsEnabled = item.EnabledState;
                    }
                    if (item.CompenetName == "navBar_musteritanim")
                    {
                        navBar_musteritanim.IsEnabled = item.EnabledState;
                    }
                    if (item.CompenetName == "navBar_urunList")
                    {
                        navBar_urunList.IsEnabled = item.EnabledState;
                    }
                    if (item.CompenetName == "Ribbonpage_AlimSatim")
                    {
                        Ribbonpage_AlimSatim.IsEnabled = item.EnabledState;
                    }
                }
            });
        }
Esempio n. 3
0
        private void navBar_musteritanim_Click(object sender, EventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                RibbonPageGroup_Home.IsEnabled = true;
                CusUC             = new CustomerUserControl();
                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = navBar_musteritanim.Content,
                    Content    = CusUC,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == navBar_musteritanim.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }
                TabControlMain.Items.Add(tabItem);
            });
        }
Esempio n. 4
0
        private void basketAdd_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                UCSepet           = new UCSepet();
                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = basketAdd.Content,
                    Content    = UCSepet,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == basketAdd.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }

                TabControlMain.Items.Add(tabItem);
                AcceptBasket.IsEnabled = true;
                CancelBasket.IsEnabled = true;
            });
        }
Esempio n. 5
0
        private void navBar_raporList_Click(object sender, EventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                RibbonPageGroup_Home.IsEnabled = false;
                UCReport          = new UCReport();
                DXTabItem tabItem = new DXTabItem()
                {
                    Header     = navBar_raporList.Content,
                    Content    = UCReport,
                    AllowHide  = DevExpress.Utils.DefaultBoolean.True,
                    IsSelected = true
                };

                foreach (DXTabItem item in TabControlMain.Items)
                {
                    if (item.Header == navBar_raporList.Content)
                    {
                        TabControlMain.RemoveTabItem(item);
                        break;
                    }
                }
                TabControlMain.Items.Add(tabItem);
            });
        }
Esempio n. 6
0
        public void RibbonController()
        {
            ExceptionCatcher.ExceptionFinder(() =>
            {
                string selectedTabCaption = TabControlMain.SelectedContainer.Header.ToString();

                if (selectedTabCaption == captionUrunTanim)
                {
                    saveButton.IsEnabled   = false;
                    cancelButton.IsEnabled = false;
                    AddButton.IsEnabled    = true;
                    editButton.IsEnabled   = true;
                    deleteButton.IsEnabled = true;
                }
                if (selectedTabCaption == captionMusteriTanim)
                {
                    saveButton.IsEnabled   = false;
                    cancelButton.IsEnabled = false;
                    AddButton.IsEnabled    = true;
                    editButton.IsEnabled   = true;
                    deleteButton.IsEnabled = true;
                }
                if (selectedTabCaption == captionPersonelTanim)
                {
                    saveButton.IsEnabled   = false;
                    cancelButton.IsEnabled = false;
                    AddButton.IsEnabled    = true;
                    editButton.IsEnabled   = true;
                    deleteButton.IsEnabled = true;
                }
            });
        }
Esempio n. 7
0
        public void AcceptedBasket()
        {
            ExceptionCatcher.ExceptionFinder(() => {
                if (combobox_musteri.SelectedItem == null)
                {
                    MessageBox.Show("Müşteri Seçiniz!");
                }
                else
                {
                    using (SDB sdb = new SDB())
                    {
                        for (int i = 0; i < SepetHelper.Sepet.Count; i++)
                        {
                            Sati sati        = new Sati();
                            sati.SatisUrunID = SepetHelper.Sepet[i].UrunID;
                            sati.SatisTarih  = DateTime.Now;
                            sati.SatisAdet   = SepetHelper.Sepet[i].urunAdet;
                            sati.SatisFiyat  = Convert.ToDecimal(SepetHelper.Sepet[i].urunToplamFiyat);
                            sati.SatisPerID  = AuthenticateHelperr.LoginUser[0].PersonelID;
                            sati.SatisMusID  = Convert.ToInt32(combobox_musteri.EditValue);

                            DAL.DAL dal = new DAL.DAL();
                            dal.SatisRapor(sati);
                        }
                        MainWindow window = (MainWindow)Window.GetWindow(this);
                        MessageBox.Show("Satış Yapıldı");
                        window.TabControlMain.SelectedContainer.Close();
                        window.AcceptBasket.IsEnabled = false;
                        window.CancelBasket.IsEnabled = false;
                        SepetHelper.Sepet             = null;
                    }
                }
            });
        }
Esempio n. 8
0
        private void DeleteRow_Click(object sender, RoutedEventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() => {
                var id = Convert.ToInt16(gridControl_sepet.GetFocusedRowCellValue(gridcolumn_urunId));

                if (SepetHelper.Sepet.Exists(x => x.UrunID == id))
                {
                    int rowIndex            = SepetHelper.Sepet.FindIndex(x => x.UrunID == id);
                    MessageBoxResult result = DXMessageBox.Show("Ürünü Silinecek Onaylıyor Musunuz?", "Uyarı", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, MessageBoxOptions.None);
                    switch (result)
                    {
                    case MessageBoxResult.Yes:
                        SepetHelper.Sepet.RemoveAt(rowIndex);
                        MessageBox.Show("Ürün Silindi!");
                        gridControl_sepet.ItemsSource = null;
                        GetSepetList();

                        break;

                    case MessageBoxResult.No:
                        break;
                    }
                }
            });
        }
Esempio n. 9
0
 private void SatisRaporList()
 {
     ExceptionCatcher.ExceptionFinder(() => {
         DAL.DAL dal = new DAL.DAL();
         List <SatisEntity> raporList   = dal.SatisRaporList();
         gridcontrol_report.ItemsSource = raporList;
     });
 }
Esempio n. 10
0
 private void GetPersonelList()
 {
     ExceptionCatcher.ExceptionFinder(() => {
         DAL.DAL dal = new DAL.DAL();
         List <PersonelEntity> list       = dal.GetPersoneList();
         gridcontrol_personel.ItemsSource = list;
     });
 }
Esempio n. 11
0
 //Siparişi Kapatıp Database e Kaydedicek//
 private void AcceptBasket_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
 {
     ExceptionCatcher.ExceptionFinder(() =>
     {
         Type type       = ((UCSepet)UCSepet).GetType();
         MethodInfo info = type.GetMethod(e.Item.Tag.ToString());
         info.Invoke(UCSepet, null);
     });
 }
Esempio n. 12
0
 public void NewRecord()
 {
     ExceptionCatcher.ExceptionFinder(() => {
         if (gridPersonelForm.Visibility == Visibility.Collapsed)
         {
             personelEntity = null;
             gridPersonelForm.Visibility = Visibility.Visible;
         }
     });
 }
Esempio n. 13
0
 private void ClearForm()
 {
     ExceptionCatcher.ExceptionFinder(() => {
         personelEntity        = null;
         personalName.Text     = null;
         personelLastname.Text = null;
         Per_pic_url.Text      = null;
         per_image.Source      = null;
     });
 }
Esempio n. 14
0
 public void CancelItem()
 {
     ExceptionCatcher.ExceptionFinder(() => {
         gridPersonelForm.Visibility = Visibility.Collapsed;
         personalName.Text           = null;
         personelLastname.Text       = null;
         Per_pic_url.Text            = null;
         personelUsername.Text       = null;
         personelPassword.Text       = null;
     });
 }
Esempio n. 15
0
        public void AddNewItem()
        {
            ExceptionCatcher.ExceptionFinder(() => {
                using (SDB sdbContext = new SDB())
                {
                    if (personelEntity == null)
                    {
                        Personel personel         = new Personel();
                        personel.PersonelAd       = personalName.Text;
                        personel.PersonelSoyad    = personelLastname.Text;
                        personel.PersonelRoleID   = chkboxAdmin.IsChecked.Value == true ? int.Parse(chkboxAdmin.Tag.ToString()) : chkboxUser.IsChecked.Value == true ? int.Parse(chkboxUser.Tag.ToString()) : int.Parse(chkboxUser2.Tag.ToString());
                        personel.PersonelUsername = personelUsername.Text;
                        personel.PersonelPassword = HashingHelper.HashingPassword(personelPassword.Text);

                        personel.PersonelPic = ImageHelper.ConvertImageToByte(Per_pic_url.Text);
                        DAL.DAL dal          = new DAL.DAL();
                        dal.NewRecordPer(personel);

                        gridPersonelForm.Visibility      = Visibility.Collapsed;
                        gridcontrol_personel.ItemsSource = null;
                        GetPersonelList();
                    }
                    else
                    {
                        Personel personel         = new Personel();
                        personel.PersonelID       = personelEntity.PersonelID;
                        personel.PersonelAd       = personalName.Text;
                        personel.PersonelSoyad    = personelLastname.Text;
                        personel.PersonelRoleID   = chkboxAdmin.IsChecked.Value == true ? int.Parse(chkboxAdmin.Tag.ToString()) : chkboxUser.IsChecked.Value == true ? int.Parse(chkboxUser.Tag.ToString()) : int.Parse(chkboxUser2.Tag.ToString());
                        personel.PersonelUsername = personelUsername.Text;
                        personel.PersonelPassword = HashingHelper.HashingPassword(personelPassword.Text);
                        if (personelEntity.PersonelPic != null)
                        {
                            personel.PersonelPic = personelEntity.PersonelPic;
                        }


                        DAL.DAL dal = new DAL.DAL();
                        dal.UpdateRecordPer(personel);
                        MainWindow window = (MainWindow)Window.GetWindow(this);
                        window.RibbonController();
                        gridPersonelForm.Visibility      = Visibility.Collapsed;
                        gridcontrol_personel.ItemsSource = null;
                        GetPersonelList();
                        ClearForm();
                    }
                }
            });
        }
Esempio n. 16
0
        //Siparişten Vazgeçersek//
        private void CancelBasket_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            ExceptionCatcher.ExceptionFinder(() => {
                MessageBoxResult result = DXMessageBox.Show("Sepeti İptal Etmek İstiyor Musunuz?", "Uyarı", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, MessageBoxOptions.None);
                switch (result)
                {
                case MessageBoxResult.Yes:

                    TabControlMain.SelectedContainer.Close();
                    SepetHelper.Sepet = null;
                    break;

                case MessageBoxResult.No:
                    break;
                }
            });
        }