public void OnSubmit()
        {
            Operation = new Operation
            {
                CompanyId       = SelectedCompany.Id,
                LocationId      = SelectedLocation.Id,
                Name            = ToUserFromStore.Name,
                Surname         = ToUserFromStore.Surname,
                OperationTypeId = OperationTypeEnums.DepodanKullaniciya,
                StoreId         = ToUserFromStore.StoreId,
                UserId          = LoggedInUser.LoggedUser.Id,
                UpdatededDate   = DateTime.Now,
                Guncel          = true
            };

            var result = OperationBll.AddOrUpdate(Operation);

            if (result)
            {
                MessageBox.Show("Kayıt Girildi", "Bilgilendirme Mesajı", MessageBoxButton.OK, MessageBoxImage.Information);
                var store = StoreBll.GetByFilter(x => x.InventoryNumber == ToUserFromStore.InventoryNumber);
                store.Kullanimda = true;
                store.StatusId   = StatusEnums.Kullanimda;
                result           = StoreBll.AddOrUpdate(store);
            }
        }
 public SearchStoreViewModel()
 {
     StoreBll = new StoreBll();
     if (!ViewModelBase.IsInDesignMode)
     {
         InitializeInRuntime();
     }
     else
     {
         InitializeInDesingMode();
     }
 }
        public ToUserFromStoreViewModel()
        {
            StoreBll           = new StoreBll();
            CompanyBll         = new CompanyBll();
            LocationBll        = new LocationBll();
            OperationBll       = new OperationBll();
            ToUserFromStore    = new ToUserFromStoreModel();
            Company            = new ObservableCollection <CompanyModel>();
            Location           = new ObservableCollection <LocationModel>();
            SearchCommand      = new RelayCommand <string>(OnSearch);
            SubmitCommand      = new RelayCommand(OnSubmit);
            OperationTypeEnums = new OperationTypeEnums();
            StatusEnums        = new StatusEnums();

            BindData();
        }
        void InitializeInRuntime()
        {
            Stores = StoreBll.GetAllList(x => x.Kullanimda == false);

            StoresModel = new List <Models.Store>();
            foreach (var item in Stores)
            {
                var store = new Models.Store()
                {
                    OperationTime   = item.OperationTime,
                    InventoryNumber = item.InventoryNumber,
                    SerialNumber    = item.SerialNumber,
                    WarrantyStart   = item.WarrantyStart,
                    Model           = item.Model.Name,
                    DeviceType      = item.Model.DeviceType.Name,
                    Description     = item.Description
                };
                StoresModel.Add(store);
            }
        }
 public void OnSearch(string inventoryNumber)
 {
     if (inventoryNumber != "")
     {
         var store = StoreBll.GetByFilter(x => x.InventoryNumber == inventoryNumber && x.Kullanimda == false);
         if (store != null)
         {
             ToUserFromStore.DeviceType      = store.Model.DeviceType.Name;
             ToUserFromStore.InventoryNumber = store.InventoryNumber;
             ToUserFromStore.Model           = store.Model.Name;
             ToUserFromStore.OperationTime   = DateTime.Now;
             ToUserFromStore.Registrant      = LoggedInUser.LoggedUser.Name + " " + LoggedInUser.LoggedUser.Surname;
             ToUserFromStore.SerialNumber    = store.SerialNumber;
             ToUserFromStore.StoreId         = store.Id;
             ToUserFromStore.WarrantyStart   = store.WarrantyStart;
         }
         else
         {
             MessageBox.Show("Kayıt Bulunamadı", "Bilgilendirme Mesajı", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
 }
        static DependencyResolver()
        {
            Logger = new Log4net();

            RoleDao          = new RoleDao(Logger);
            UserDao          = new UserDao(Logger, RoleDao);
            CategoryDao      = new CategoryDao(Logger);
            ProductDao       = new ProductDao(Logger, CategoryDao);
            StoreDao         = new StoreDao(Logger);
            VendorDao        = new VendorDao(Logger);
            StatusDao        = new StatusDao(Logger);
            CommodityUnitDao = new CommodityUnitDao(Logger, ProductDao, StatusDao, StoreDao, VendorDao);

            RoleBll          = new RoleBll(Logger, RoleDao);
            UserBll          = new UserBll(Logger, RoleBll, UserDao);
            CategoryBll      = new CategoryBll(Logger, CategoryDao, CommodityUnitDao);
            ProductBll       = new ProductBll(Logger, CategoryBll, ProductDao, CommodityUnitDao);
            StoreBll         = new StoreBll(Logger, StoreDao, CommodityUnitDao);
            VendorBll        = new VendorBll(Logger, VendorDao, CommodityUnitDao);
            StatusBll        = new StatusBll(Logger, StatusDao, CommodityUnitDao);
            CommodityUnitBll = new CommodityUnitBll(Logger, CategoryBll, ProductBll, StatusBll, StoreBll, VendorBll, CommodityUnitDao);

            AuthenticationBll = new AuthenticationBll(UserBll);
        }