Esempio n. 1
0
 public ucDelivery(PartsDetail oPartsDetail)
 {
     InitializeComponent();
     this.oPartsDetail = oPartsDetail;
     InitializeWindow();
     oAllCarList = App.oAllCarList;
     this.oAllReapirsHistory = App.oAllRepairsHistory;
     dtgCars.ItemsSource = oAllCarList;
 }
Esempio n. 2
0
        public List<PartsDetail> SelectAll()
        {
            try
            {
                List<PartsDetail> oPartDetailList = new List<PartsDetail>();

                PartsDetail oPartsDetail = new PartsDetail();
                oPartsDetail.Id = 1;
                oPartsDetail.count = 20;
                oPartsDetail.manufacturer = new Manufacturer().SelectAll()[0];
                oPartsDetail.minimum = 3;
                oPartsDetail.parts = new Parts().SelectAll()[0];
                oPartsDetail.price = 4000;
                oPartDetailList.Add(oPartsDetail);

                oPartsDetail = new PartsDetail();
                oPartsDetail.Id = 2;
                oPartsDetail.count = 24;
                oPartsDetail.manufacturer = new Manufacturer().SelectAll()[1];
                oPartsDetail.minimum = 5;
                oPartsDetail.parts = new Parts().SelectAll()[1];
                oPartsDetail.price = 5000;
                oPartDetailList.Add(oPartsDetail);

                oPartsDetail = new PartsDetail();
                oPartsDetail.Id = 3;
                oPartsDetail.count = 7;
                oPartsDetail.manufacturer = new Manufacturer().SelectAll()[0];
                oPartsDetail.minimum = 6;
                oPartsDetail.parts = new Parts().SelectAll()[1];
                oPartsDetail.price = 1000;
                oPartDetailList.Add(oPartsDetail);

                return oPartDetailList;

            

            }
            catch (Exception)
            {
                
                throw;
            }
        }
 public ucAddEditPartsDetail(PartsDetail oPartsDetail, bool isEdit)
 {
     InitializeComponent();
     try
     {
         this.oPartsDetail = oPartsDetail;
         this.isEdit = isEdit;
         cboParts.ItemsSource = new Parts().SelectAll();
         cboManufacturer.ItemsSource = new Manufacturer().SelectAll();
         if (isEdit)
         {
             InitializeWindow();
         }
         
     }
     catch (Exception)
     {
         
         MessageBox.Show("Can not initialize window");
     }
 }
Esempio n. 4
0
        public List <PartsDetail> SelectAll()
        {
            try
            {
                List <PartsDetail> oPartDetailList = new List <PartsDetail>();

                PartsDetail oPartsDetail = new PartsDetail();
                oPartsDetail.Id           = 1;
                oPartsDetail.count        = 20;
                oPartsDetail.manufacturer = new Manufacturer().SelectAll()[0];
                oPartsDetail.minimum      = 3;
                oPartsDetail.parts        = new Parts().SelectAll()[0];
                oPartsDetail.price        = 4000;
                oPartDetailList.Add(oPartsDetail);

                oPartsDetail              = new PartsDetail();
                oPartsDetail.Id           = 2;
                oPartsDetail.count        = 24;
                oPartsDetail.manufacturer = new Manufacturer().SelectAll()[1];
                oPartsDetail.minimum      = 5;
                oPartsDetail.parts        = new Parts().SelectAll()[1];
                oPartsDetail.price        = 5000;
                oPartDetailList.Add(oPartsDetail);

                oPartsDetail              = new PartsDetail();
                oPartsDetail.Id           = 3;
                oPartsDetail.count        = 7;
                oPartsDetail.manufacturer = new Manufacturer().SelectAll()[0];
                oPartsDetail.minimum      = 6;
                oPartsDetail.parts        = new Parts().SelectAll()[1];
                oPartsDetail.price        = 1000;
                oPartDetailList.Add(oPartsDetail);

                return(oPartDetailList);
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void btnAddPartsDetail_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PartsDetail oPartsDetail = new PartsDetail();

                ucAddEditPartsDetail oucAddEditPartsDetail = new ucAddEditPartsDetail(oPartsDetail,false);

                winDialog oDialog = new winDialog(oucAddEditPartsDetail)
                {
                    ShowInTaskbar = true,
                    WindowTitle = "Add a new Parts",
                    Height = 240,
                    Width = 560
                };
                oDialog.ShowDialog();

                dtgItems.Items.Refresh();

            }
            catch (Exception)
            {

                MessageBox.Show("Can not add parts");
            }
        }