示例#1
0
        private void frmImportMaterial_Load(object sender, EventArgs e)
        {
            ComboboxUtility.BindStock(autoSearchCombobox1);
            gridutility.BindingData(lisImportMaterial);
            DateTime firstDay      = DateTime.Today.AddDays(1 - DateTime.Today.Day);
            DateTime lastDayFilter = firstDay.AddMonths(1).AddDays(-1);

            dtpTimeFrom.EditValue = firstDay;
            dtpTimeTo.EditValue   = lastDayFilter;
            btnSearch.PerformClick();
        }
示例#2
0
        private void LoadGrid()
        {
            IList <Debt> lstDebt;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstDebt = uow.DebtRepository.Search("");
                uow.Commit();
            }
            gridUtility.BindingData(lstDebt);
        }
示例#3
0
        private void LoadGrid()
        {
            IList <Planning> lstPlanning;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstPlanning = uow.PlanningRepository.All(dtpFromdate.DateTime, dtpTodate.DateTime);
                uow.Commit();
            }
            gridUtility.BindingData <Planning>(lstPlanning);
        }
示例#4
0
        private void gridViewBank_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            Model.Bank bank = gridUtility1.GetSelectedItem <Model.Bank>();
            IList <Model.BrankBank> lstBranch = new List <Model.BrankBank>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstBranch = uow.BrankBankBaseRepository.GetAllBrankByBankID(bank.BankId.ToString());
                uow.Commit();
            }
            gridUtility2.BindingData(lstBranch);
        }
示例#5
0
        private void frmEditQuotation_Load(object sender, EventArgs e)
        {
            IList <QuotationDetail> lstQuotationDetail;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstQuotationDetail = uow.QuotationDetailRepository.Find(m_Quotation);
                m_Company          = uow.CompanyRepository.Find(m_Company.CompanyId);
                uow.Commit();
            }
            InititalizeForm(m_Quotation);
            gridUtility.BindingData <QuotationDetail>(lstQuotationDetail);
        }
示例#6
0
        private void frmProjectMain_Load(object sender, EventArgs e)
        {
            IList <Project> lstPro = new List <Project>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstPro = uow.ProjectBaseRepository.All();
                uow.Commit();
            }

            utility.BindingData(lstPro);
            dtpDateBegin.EditValue = dtpDateEnd.EditValue = DateTime.Now;
        }
示例#7
0
        private void LoadGrid()
        {
            DateTime          fromDate = UtilityFunction.GetDatetime(dtpFromDate);
            DateTime          toDate   = UtilityFunction.GetDatetime(dtpTodate);
            IList <Quotation> lstQuotation;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstQuotation = uow.QuotationRepository.LookByDate(fromDate, toDate);
                uow.Commit();
            }
            gridUtility.BindingData <Quotation>(lstQuotation);
        }
示例#8
0
        private void LoadGrid()
        {
            IList <Po> lstPo;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstPo = uow.PoRepository.Search(dtpFromDate.DateTime, dtpTodate.DateTime);
                uow.Commit();
            }
            if (lstPo != null)
            {
                gridUtility.BindingData <Po>(lstPo);
            }
        }
示例#9
0
        private void LoadGrid()
        {
            IList <QuotationDetail> lstProduct;

            m_Po.Quotation = new Quotation();
            m_Po.Quotation.QuotationCode = m_Po.QuotationCode;
            using (IUnitOfWork uow = new UnitOfWork())
            {
                m_Po.Quotation = uow.QuotationRepository.Find(m_Po.QuotationCode);
                m_Company      = uow.CompanyRepository.Find(m_Po.CompanyId);
                lstProduct     = uow.QuotationDetailRepository.Find(m_Po.Quotation);
                uow.Commit();
            }
            gridUtility.BindingData <QuotationDetail>(lstProduct);
        }
示例#10
0
 private void Loadsubsupplier(Model.Supplier supplier, IList <SubSupplier> lstDeputy = null)
 {
     if (m_Suplier == null)
     {
         return;
     }
     if (lstDeputy == null)
     {
         using (IUnitOfWork uow = new UnitOfWork())
         {
             lstDeputy = uow.SubSupplierRepository.GetbySupplier(supplier);
             uow.Commit();
         }
     }
     gridUtility1.BindingData <SubSupplier>(lstDeputy);
     if (lstDeputy != null)
     {
         m_Subsupplier = lstDeputy.Where(p => p.IsMain == true).FirstOrDefault();
         if (m_Subsupplier == null)
         {
             m_Subsupplier = new SubSupplier();
         }
         InitializeForm(m_Subsupplier);
     }
     //cbbIsMainDeputy.Checked = deputy.IsMain;
 }
示例#11
0
        private void LoadCompany()
        {
            IList <Company>     lstCompany;
            List <CompanyClass> lstClass;
            List <CompanyType>  lstType;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstCompany = uow.CompanyRepository.All();
                lstClass   = uow.CompanyRepository.AllClass();
                lstType    = uow.CompanyTypeRepository.All();
                uow.Commit();
            }
            gridUtility2.BindingData(lstCompany);
            ComboboxUtility.BindCompanyClass(cbbClass, lstClass, 0);
            ComboboxUtility.BindCompanyType(cbbType, lstType, 0);
        }
示例#12
0
        public void LoadGrid()
        {
            List <Model.Quotation> lstQuotation;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                if (m_Company == null)
                {
                    lstQuotation = uow.QuotationRepository.Search(txtSearch.Text);
                }
                else
                {
                    lstQuotation = uow.QuotationRepository.LookByCompany(m_Company);
                }
                uow.Commit();
            }
            gridUtility.BindingData <Model.Quotation>(lstQuotation);
        }
示例#13
0
 public void LoadMessage(List <ErrorData> lstData)
 {
     if (_lstData == null)
     {
         _lstData = new List <ErrorData>();
     }
     gridUtility.BindingData(_lstData);
     this.ShowDialog();
 }
示例#14
0
        private void searchByName(string text)
        {
            IList <Product> lstProduct;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstProduct = uow.ProductRepository.FindByName(text);
                uow.Commit();
            }
            gridUtility.BindingData <Product>(lstProduct);
            Product first = lstProduct.FirstOrDefault();

            if (first == null)
            {
                return;
            }
            OpenTreeNode(first.SeriesId);
        }
示例#15
0
 private void ShowProductMaterial(Product product)
 {
     IList<Model.Material> lstMaterial;
     using (IUnitOfWork uow = new UnitOfWork())
     {
         lstMaterial = uow.MaterialRepository.GetMaterialByProductId(product.ProductId, product.Quantity).Where(p => p.MaterialQuantity > 0).ToList();
         uow.Commit();
     }
     gridUtility.BindingData<Model.Material>(lstMaterial);
 }
示例#16
0
        private void loadLocationDB()
        {
            IList <Location> lstLocation = new List <Location>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstLocation = uow.LocationRepository.GetAll();
                uow.Commit();
            }
            gridUtility.BindingData(lstLocation);
        }
示例#17
0
        private void LoadGrid()
        {
            IList <DebtDetail> lstDebtDetail;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstDebtDetail = uow.DebtRepository.Find(m_Debt);
                uow.Commit();
            }
            gridUtility.BindingData(lstDebtDetail);
        }
示例#18
0
        private void frmPaymentMethodMain_Load(object sender, EventArgs e)
        {
            IList <PaymentMethod> lstPm = new List <PaymentMethod>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstPm = uow.PaymentMethodRepository.All();
                uow.Commit();
            }
            gridUtility.BindingData(lstPm);
        }
示例#19
0
        private void loadStockDB()
        {
            IList <Stock> lstStock = new List <Stock>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstStock = uow.StockRepository.GetAll();
                uow.Commit();
            }
            gridUtility.BindingData(lstStock);
        }
示例#20
0
        private void loadUnitDB()
        {
            IList <Unit> lstUnit = new List <Unit>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstUnit = uow.UnitRepository.All();
                uow.Commit();
            }
            gridUtility.BindingData(lstUnit);
        }
示例#21
0
        private void LoadGrid(string propertyName)
        {
            IList <CustomModel.ProductProperty> lstProperty;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstProperty = uow.ProductRepository.getProperty(propertyName, m_Product);
                uow.Commit();
            }
            gridUtility.BindingData <CustomModel.ProductProperty>(lstProperty);
        }
示例#22
0
        private void LoadStaff(int departmentId)
        {
            IList <Staff> lstStaff;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstStaff = uow.StaffRepository.FindByDepartment(departmentId);
                uow.Commit();
            }
            gridUtility2.BindingData <Staff>(lstStaff);
        }
示例#23
0
        public void LoadGrid()
        {
            IList <Model.Department> lstDepartment;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstDepartment = uow.DepartmentRepository.All();
                uow.Commit();
            }
            gridUtility.BindingData <Model.Department>(lstDepartment);
        }
示例#24
0
        private void loadProductTypeDB()
        {
            IList <ProductType> lstProductType = new List <ProductType>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstProductType = uow.ProductTypeRepository.GetAll();
                uow.Commit();
            }
            gridUtility.BindingData(lstProductType);
        }
示例#25
0
        private void loadDB()
        {
            IList <Model.Bank> lstBank = new List <Model.Bank>();

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstBank = uow.BankBaseRepository.All();
            }

            gridUtility1.BindingData(lstBank);
        }
示例#26
0
        private void LoadDepartment()
        {
            IList <Department> lstDepartment;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstDepartment = uow.DepartmentRepository.All();
                uow.Commit();
            }
            gridUtility1.BindingData <Department>(lstDepartment);
            gridUtility3.BindingData <Department>(lstDepartment);
        }
示例#27
0
 private void LoadGrid(IList <QuotationDetail> lstQuotationDetail, Quotation quotation)
 {
     gridUtility.BindingData <QuotationDetail>(lstQuotationDetail);
     m_Po.Quotation     = quotation;
     m_Comapny          = quotation.Company;
     m_Po.CompanyId     = m_Comapny.CompanyId;
     m_Po.Company       = m_Comapny;
     m_Po.QuotationCode = quotation.QuotationCode;
     m_Po.CreateDebt    = true;
     InitializeForm(m_Po);
     isEdited = true;
 }
示例#28
0
        private void LoadGrid(QuotationDetail quotationDetail)
        {
            IList <QuotationDetail> lstOrigin = gridControl1.DataSource as IList <QuotationDetail>;

            if (lstOrigin == null)
            {
                lstOrigin = new List <QuotationDetail>();
            }
            lstOrigin.Add(quotationDetail);
            gridUtility.BindingData <QuotationDetail>(lstOrigin);
            //gridUtility.AddNewRow<QuotationDetail>(quotationDetail);
            isEdited = true;
        }
示例#29
0
 private void loadDB(DateTime dt)
 {
     lstincome = new List <IncomeExpense>();
     using (IUnitOfWork uow = new UnitOfWork())
     {
         lstincome = uow.IncomeExpenseRepository.Find(dt);
         uow.Commit();
     }
     if (lstincome == null)
     {
         return;
     }
     gridUtility.BindingData(lstincome);
 }
示例#30
0
        public void LoadGrid()
        {
            IList <Category> lstCategory;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstCategory = uow.CategoryRepository.All();
                uow.Commit();
            }
            if (lstCategory != null)
            {
                gridUtility.BindingData <Category>(lstCategory);
            }
        }