Example #1
0
 void LoadData()
 {
     try
     {
         c_lst = c_Category_Controller.Get_All();
         dgrCategory.ItemsSource = c_lst;
         DataGridHelper.NVSFocus(dgrCategory, 0, 0);
     }
     catch (Exception ex)
     {
         CommonData.log.Error(ex.ToString());
     }
 }
Example #2
0
        Hashtable c_hs_color = new Hashtable(); // Danh sách màu Key ID
        #endregion

        #region Events

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                dpReceiveDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
                txtProduct_Name.Focus();

                Category_Controller  _Category_Controller = new Category_Controller();
                List <Category_Info> _lst = _Category_Controller.Get_All();

                cboItem_Type.DisplayMemberPath = "Category_Name";
                cboItem_Type.SelectedValuePath = "Category_Id";

                cboItem_Type.ItemsSource   = _lst;
                cboItem_Type.SelectedIndex = 0;

                Supplier_Controller  _Supplier_Controller = new Supplier_Controller();
                List <Supplier_Info> _lst1 = _Supplier_Controller.Get_All();

                cboSupplier.DisplayMemberPath = "Supplier_Name";
                cboSupplier.SelectedValuePath = "Supplier_Id";

                cboSupplier.ItemsSource   = _lst1;
                cboSupplier.SelectedIndex = 0;


                Allcode_Controller  _Allcode_Controller = new Allcode_Controller();
                List <AllCode_Info> _lst2 = _Allcode_Controller.Get_AllCode_ByCdNameCdType("PRODUCT", "UNIT");

                cboUnit.SelectedValuePath = "CdValue";
                cboUnit.DisplayMemberPath = "Content";
                cboUnit.ItemsSource       = _lst2;
                cboUnit.SelectedIndex     = 0;

                Create_SoHoaDon();
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }