Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Trabalho.LTP.Dominio.ItensRoot.Item model = MapearDominio();



            IItemServices service = Program.container.GetInstance <IItemServices>();

            if (service.Adicionar(model))
            {
                PreencherGrid();

                MessageBox.Show(this, "Item Adicionado com sucesso.", "Trabalho", MessageBoxButtons.OK, MessageBoxIcon.Information);

                LimparComponentes();

                TxtName.Focus();
            }
            else
            {
                TxtName.Focus();

                MessageBox.Show(this, "Item não Cadastrado.\n \n" + service.ObterNotificacoes(), "Trabalho", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void PopulateComboboxBarang()
        {
            _itemRepo = new ItemServices();
            var Data = AutoMapper.Mapper.Map <List <MasterItemDto> >(_itemRepo.GetAll().Where(x => x.STATUS == Status.Aktif));

            _dataBarang = CollectionViewSource.GetDefaultView(Data);

            _dataBarang.Filter = new Predicate <object>(FilterCandidates);

            var TransportCompositeCollection = new CompositeCollection();

            TransportCompositeCollection.Add(new ComboBoxItem()
            {
                Content = "Please Select"
            });
            TransportCompositeCollection.Add(new CollectionContainer()
            {
                Collection = _dataBarang
            });

            NamaBarang.ItemsSource = TransportCompositeCollection;

            filters.Clear();
            if (_dataBarang != null)
            {
                AddFilterAndRefresh("JENIS_BARANG", candidate => (JenisBarang.SelectedItem.GetType() == typeof(ItemType) && candidate.JENIS_BARANG == (ItemType)JenisBarang.SelectedItem));
            }
            //NamaBarang.SelectedValuePath = "ID";
            //NamaBarang.DisplayMemberPath = "NAMA_BARANG";
            NamaBarang.SelectedIndex = 0;
        }
Пример #3
0
 public ReportController(IHostingEnvironment hostingEnvironment, IBoardServices board, ITodoServices todo, IItemServices item, IMemosServices memo)
 {
     this.hostingEnvironment = hostingEnvironment;
     this.board = board;
     this.todo  = todo;
     this.item  = item;
     this.memo  = memo;
 }
Пример #4
0
        public Home_Details(int Id)
        {
            _itemRepo          = new ItemServices();
            _pekerjaRepo       = new PekerjaServices();
            _supplierServices  = new SupplierServices();
            _transportServices = new TransportServices();
            _trnServices       = new TRNBongkarMuatServices();

            var Data = _trnServices.GetById(Id);

            InitializeComponent();

            PopulateComboboxBarang();
            PopulateComboboxPetugas();
            PopulateComboboxNamaPengirim();
            PopulateComboboxNoPolisi();

            if (Data != null)
            {
                var Dto = AutoMapper.Mapper.Map <TRNBongkarMuatDto>(Data);
                IdHome.Text = Dto.ID.ToString();

                TglKirim.Text = Dto.TANGGAL_KIRIM.ToString("dd MMM yyyy");

                Kegiatan.SelectedItem    = Dto.KEGIATAN;
                JenisBarang.SelectedItem = Dto.JENIS_BARANG;

                NamaBarang.SelectedValuePath = "ID";
                NamaBarang.SelectedValue     = Dto.master_item.ID;

                NamaPengirim.SelectedValuePath = "ID";
                NamaPengirim.SelectedValue     = Dto.master_supplier.ID;

                NoPolisi.SelectedValuePath = "ID";
                NoPolisi.SelectedValue     = Dto.master_transport.ID;

                Kwantum.Text = string.Format("{0:N0}", Dto.KWANTUM.Value);

                Berangkat.Value = Dto.BERANGKAT.TimeOfDay;
                Sampai.Value    = Dto.SAMPAI.TimeOfDay;

                Ongkos.Text = Dto.ONGKOS.ToString();

                Harga.Text          = Dto.HARGA.HasValue ? Dto.HARGA.Value.ToString("{0:N2}") : "0";
                TotalHarga.Text     = Dto.TOTAL_HARGA.HasValue ? Dto.TOTAL_HARGA.Value.ToString("{0:N0}") : "0";
                HargaKontainer.Text = Dto.HARGA_KONTAINER.HasValue ? Dto.HARGA_KONTAINER.Value.ToString("{0:N0}"):"0";
                TotalKontainer.Text = Dto.TOTAL_KONTAINER.HasValue ? Dto.TOTAL_KONTAINER.Value.ToString("{0:N0}") : "0";

                var ListPetugas    = Dto.trn_bongkat_muat_details_pekerja.Select(x => x.master_petugas).ToList();
                var ListPetugasDto = AutoMapper.Mapper.Map <List <MasterPetugasDto> >(ListPetugas);
                foreach (var pekerja in ListPetugasDto)
                {
                    ListPekerja.Items.Add(pekerja);
                    ListPekerja.DisplayMemberPath = "NAMA_PETUGAS";
                }
            }
            TglKirim.IsReadOnly = true;
        }
Пример #5
0
        private void Btn_Simpan_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _itemServices = new ItemServices();

                if (JenisBarang.SelectedItem.GetType() != typeof(ItemType))
                {
                    MessageBox.Show("Jenis Barang harus dipilih", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                if (string.IsNullOrEmpty(NamaBarang.Text))
                {
                    MessageBox.Show("Nama Barang tidak boleh kosong", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                if (string.IsNullOrEmpty(HargaBarang.Text))
                {
                    MessageBox.Show("Harga Barang tidak boleh kosong", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                if (string.IsNullOrEmpty(OngkosKontainer.Text))
                {
                    MessageBox.Show("Ongkos Kontainer tidak boleh kosong", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                var Dto = new MasterItemDto();
                Dto.NAMA_BARANG      = NamaBarang.Text;
                Dto.HARGA            = decimal.Parse(HargaBarang.Text);
                Dto.JENIS_BARANG     = (ItemType)JenisBarang.SelectedItem;
                Dto.ONGKOS_CONTAINER = decimal.Parse(OngkosKontainer.Text);
                Dto.STATUS           = Core.Status.Aktif;
                Dto.ID = int.Parse(IdBarang.Text);

                var DataExisting = _itemServices.GetAll().Where(x => !string.IsNullOrEmpty(x.NAMA_BARANG) &&
                                                                x.NAMA_BARANG.ToUpper() == Dto.NAMA_BARANG.ToUpper() && x.JENIS_BARANG == Dto.JENIS_BARANG).FirstOrDefault();

                if (DataExisting != null && DataExisting.ID != Dto.ID)
                {
                    MessageBox.Show("Barang sudah ada di database", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }

                _itemServices.Save(Dto);
                MessageBox.Show("Update Data Sukses", "Sukses", MessageBoxButton.OK, MessageBoxImage.Information);
                CloseWin();
            }
            catch (Exception exp)
            {
                MessageBox.Show("Update Data Error", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Пример #6
0
 /// <summary>
 /// Constructor accepting itemService input
 /// </summary>
 /// <param name="itemServices"></param>
 public ItemController(IItemServices itemServices)
 {
     if (itemServices != null)
     {
         _itemServices = itemServices;
     }
     else
     {
         throw new ArgumentNullException();
     }
 }
        public Item_View()
        {
            _itemServices = new ItemServices();
            _converter    = new EnumDescriptionConverter();

            _insertWindow  = new Item_Insert();
            _detailsWindow = new Item_Details(0);

            InitializeComponent();
            Init();
        }
Пример #8
0
        private void BtRemover_Click(object sender, EventArgs e)
        {
            IItemServices service = Program.container.GetInstance <IItemServices>();

            int ID = Convert.ToInt32(TxtId.Text);


            if (service.Excluir(ID))
            {
                PreencherGrid();


                LimparComponentes();
            }
            else
            {
                MessageBox.Show(this, "Item não Atualizado.\n \n" + service.ObterNotificacoes(), "Trabalho", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #9
0
        public Item_Details(int Id)
        {
            InitializeComponent();

            _itemServices = new ItemServices();

            var Data = _itemServices.GetById(Id);

            InitializeComponent();

            if (Data != null)
            {
                IdBarang.Text             = Data.ID.ToString();
                NamaBarang.Text           = Data.NAMA_BARANG;
                JenisBarang.SelectedItem  = Data.JENIS_BARANG;
                HargaBarang.Text          = string.Format("{0:N2}", Data.HARGA);
                OngkosKontainer.Text      = string.Format("{0:N2}", Data.ONGKOS_CONTAINER);
                StatusBarang.SelectedItem = Data.STATUS;
            }
        }
        public Home_Insert()
        {
            _itemRepo          = new ItemServices();
            _pekerjaRepo       = new PekerjaServices();
            _supplierServices  = new SupplierServices();
            _transportServices = new TransportServices();
            _trnServices       = new TRNBongkarMuatServices();

            InitializeComponent();

            PopulateComboboxBarang();
            PopulateComboboxPetugas();
            PopulateComboboxNamaPengirim();
            PopulateComboboxNoPolisi();

            TglKirim.Text       = DateTime.Now.ToString("yyyy MMM dd");
            TglKirim.IsReadOnly = true;

            Berangkat.Value = new TimeSpan(0, 0, 0);
            Sampai.Value    = new TimeSpan(0, 0, 0);
        }
        private void PopulateComboboxPetugas()
        {
            _itemRepo = new ItemServices();
            var Data = AutoMapper.Mapper.Map <List <MasterPetugasDto> >(_pekerjaRepo.GetAll().Where(x => x.STATUS == Status.Aktif));

            _dataPetugas = CollectionViewSource.GetDefaultView(Data);

            var TransportCompositeCollection = new CompositeCollection();

            TransportCompositeCollection.Add(new ComboBoxItem()
            {
                Content = "Please Select"
            });
            TransportCompositeCollection.Add(new CollectionContainer()
            {
                Collection = _dataPetugas
            });

            NamaPetugas.ItemsSource   = TransportCompositeCollection;
            NamaPetugas.SelectedIndex = 0;
        }
Пример #12
0
 public Item_Insert()
 {
     _itemServices = new ItemServices();
     InitializeComponent();
 }
Пример #13
0
 public EnemiesBlock(IEnemyServices enemyServices, IItemServices itemServices)
 {
     _enemyServices = enemyServices;
     _itemServices  = itemServices;
 }
Пример #14
0
 public AddModel(IUserServices userServices, IItemServices itemServices, IProductServices productServices)
 {
     _userServices    = userServices;
     _itemServices    = itemServices;
     _productServices = productServices;
 }
 public ItemController(IItemServices ItemService)
 {
     this.ItemService = ItemService;
 }
 public ItemsController(IItemServices itemServices, IEnemyServices enemyServices)
 {
     _itemServices  = itemServices;
     _enemyServices = enemyServices;
 }
Пример #17
0
 private IItemServices _itemservice;// = new SupplierServices();
 public ItemsController(IItemServices itemServices)
 {
     _itemservice = itemServices;
 }
Пример #18
0
 public EnemyController(IEnemyServices enemyServices, IItemServices itemServices)
 {
     _enemyServices = enemyServices;
     _itemServices  = itemServices;
 }
Пример #19
0
 public ItemsController(IItemServices itemsService)
 {
     _itemsService = itemsService;
 }
Пример #20
0
 public ItemsBlock(IItemServices itemServices)
 {
     _itemServices = itemServices;
 }
Пример #21
0
 public ItemController(IItemServices ser)
 {
     this.ser = ser;
 }
Пример #22
0
 public ItemController(IItemServices itemServices)
 {
     _itemServices = itemServices;
 }
 public OrderServices(IPromotionRuleServices promotionRuleServices, IItemServices itemServices)
 {
     this._promotionRuleServices = promotionRuleServices;
     this._itemServices          = itemServices;
 }
 public OrderItemController(IItemServices itemServices, ILogger <OrderItemController> logger)
 {
     _itemLogc = itemServices;
     _logger   = logger;
 }