protected override void OnCreateControl() { ComboboxUtility.BindBank(this); this.SelectedValueChanged += CboBindBank_SelectedValueChanged; this.SelectedItem = null; base.OnCreateControl(); }
private void frmEditProject_Load(object sender, EventArgs e) { if (pro == null) { return; } IList <Staff> lstSt = new List <Staff>(); IList <Company> lstCom = new List <Company>(); IList <Status> lstSta = new List <Status>(); using (IUnitOfWork uow = new UnitOfWork()) { lstSt = uow.StaffRepository.All(); lstCom = uow.CompanyRepository.All(); lstSta = uow.ProjectBaseRepository.GetAllStatus(); uow.Commit(); } ComboboxUtility.BindData(cbbSale, lstSt, "StaffName", "StaffId"); ComboboxUtility.BindData(cbbCompany, lstCom, "CompanyName", "CompanyId"); ComboboxUtility.BindData(cbbStatus, lstSta, "StatusName", "StatusId"); CoverObjectUtility.SetAutoBindingData(this, pro); //if (pro.Sale != null) // cbbSale.SelectedValue = pro.Sale; //else // cbbSale.SelectedValue = -1; //if (pro.CompanyId != null) // cbbCompany.SelectedValue = pro.CompanyId; //else // cbbCompany.SelectedValue = -1; //if (pro.StatusId != null) // cbbStatus.SelectedValue = pro.StatusId; labelNotify1.Text = ""; }
private void cboSupplier_DropDown(object sender, EventArgs e) { if (isLoad) { isLoad = false; ComboboxUtility.BindSupplier(cboSupplier); } }
void LoadTreeview() { ProductUtility obj = new ProductUtility(treeView1); obj.BuildRootPart(); ComboboxUtility.BindSupplier(cboSupplier); FormUtility.ResetForm(this); }
public frmCreateCompany() { InitializeComponent(); _companyBussiness = new CompanyBussiness(); ComboboxUtility.BindBank(cbSelectBank); ComboboxUtility.LoadDataClassCustormer(cbClassCustormer); cbSelectBank.SelectedIndex = -1; txtAddree.Text = string.Empty; cbClassCustormer.DropDownStyle = ComboBoxStyle.DropDownList; }
private void loadStaff() { IList <Staff> lstStaff; using (UnitOfWork uow = new UnitOfWork()) { lstStaff = uow.StaffRepository.All(); uow.Commit(); } ComboboxUtility.BindData <Staff>(cbbStaff, lstStaff, "StaffName", "StaffId"); }
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(); }
public FrmEditCompany(int companyId) { InitializeComponent(); _objEditCompany = new Company { CompanyId = companyId }; ComboboxUtility.LoadDataClassCustormer(cbClassCustormer); cbClassCustormer.DropDownStyle = ComboBoxStyle.DropDownList; }
private void frmChooseToCreate_Load(object sender, System.EventArgs e) { //Load for combobox AcceptButton = btnSave; IList <Bank> lstBank = new List <Bank>(); using (IUnitOfWork uow = new UnitOfWork()) { lstBank = uow.BankBaseRepository.All(); uow.Commit(); } ComboboxUtility.BindData <Bank>(cbbBank, lstBank, "BankName", "BankId"); }
private void cbbSubCate_SelectionChangeCommitted(object sender, EventArgs e) { if (cbbSubCate.SelectedValue != null) { int subId = int.Parse(cbbSubCate.SelectedValue.ToString()); List <Series> lstSerie = cbbSerie.DataSource as List <Series>; if (lstSerie != null) { ComboboxUtility.BindSerie(cbbSerie, subId); cbbSerie.SelectedValue = -1; } } }
private void frmCreateProd_Load(object sender, EventArgs e) { ComboboxUtility.BindCategory(cbbCategory); ComboboxUtility.BindSerie(cbbSerie, 0); //ComboboxUtility.BindClassProduct(cbbClassProduct); //ComboboxUtility.BindStandard(cbbStandard); //ComboboxUtility.BindSafety(cbbClassSafety); //ComboboxUtility.BindLampType(cbbLamptype); cbbCategory.SelectedValue = m_treeTag.CateId; cbbSubCate.SelectedValue = m_treeTag.LineId; cbbSerie.SelectedValue = m_treeTag.SerieId; cbbClassProduct.SelectedValue = -1; cbbClassSafety.SelectedValue = -1; cbbStandard.SelectedValue = -1; }
private void frmProductDemo_Load(object sender, EventArgs e) { IList <Category> lstCate; IList <Series> lstSerie; using (IUnitOfWork uow = new UnitOfWork()) { lstCate = uow.CategoryRepository.All(); lstSerie = uow.SeriesRepository.All(); uow.Commit(); } ComboboxUtility.BindCategory(cbbCategory); ComboboxUtility.BindSerie(cbbSerie, 0); cbbCategory.SelectedValue = -1; }
private void cbbCompany_SelectedIndexChanged(object sender, EventArgs e) { IList <Po> lstPo = new List <Po>(); try { using (IUnitOfWork uow = new UnitOfWork()) { lstPo = uow.PoRepository.Find((cbbCompany.SelectedItem as Company)); uow.Commit(); } ComboboxUtility.BindData(cbbPO, lstPo, "PoCode", "PoId"); } catch { } }
public frmImportMaterialDetail(ImportMaterial import) { InitializeComponent(); this.import = import; gridutility = new GridUtility(gridControl2); gridControl2.ProcessGridKey += GridControl2_ProcessGridKey; gridView2.RowDeleting += GridView2_RowDeleting; labelNotify1.Text = string.Empty; ComboboxUtility.BindStock(cboStock); ComboboxUtility.BindStatus(cboStatus); CoverObjectUtility.SetAutoBindingData(this, import); cbbMaterialCode.EditValueChanged += cbbMaterialCode_EditValueChanged; //gridView2.FocusedRowHandle = -1; }
private void cbbTypePart_SelectedValueChanged(object sender, EventArgs e) { if (isLoad) { return; } TypePart type = cbbTypePart.SelectedItem as TypePart; if (type == null) { return; } int typepartId = type.TypePartID; ComboboxUtility.BindSeriesParttWidthALl(cbbSeriesPart, typepartId.ToString()); }
private void cbbGroupPart_SelectedValueChanged(object sender, EventArgs e) { if (isLoad) { return; } GroupPart group = cbbGroupPart.SelectedItem as GroupPart; if (group == null) { return; } int grouppartId = group.GroupPartId; ComboboxUtility.BindTypePartWidthALl(cbbTypePart, grouppartId.ToString()); }
private void toolStripMenuItem5_Click(object sender, EventArgs e) { TreeTagPart treetag = treeView1.SelectedNode.Tag as TreeTagPart; if (treetag != null) { isCreateNew.SeriesPartID = treetag.SeriesPartIDTag; } txtNamePart.Text = string.Empty; txtDescription.Text = string.Empty; txtPricePart.Text = string.Empty; PictureImage.InitialImage = null; FormUtility.ResetForm(pnlContent); ComboboxUtility.BindSupplier(cboSupplier); }
private void frmEditProductProperty_Load(object sender, EventArgs e) { InititalizeForm(m_QuotationDetail); using (IUnitOfWork uow = new UnitOfWork()) { List <ProductPicture> lstPicture = uow.ProductPictureRepository.FindByProduct(m_Product); m_Company = uow.CompanyRepository.Find(m_Company.CompanyId); InititalizeForm(m_Company); InititalizeForm(m_Product); displayMultiplePicture1.ImgList = new string[5]; displayMultiplePicture1.Show(lstPicture); foreach (Control c in Controls) { if (c is MetroSearchComboBox) { MetroSearchComboBox cbb = c as MetroSearchComboBox; if (cbb.Tag != null) { IList <CustomModel.ProductProperty> lstProperty = uow.ProductRepository.getProperty(cbb.Tag.ToString(), m_Product); ComboboxUtility.BindData <CustomModel.ProductProperty>(cbb, lstProperty, "Value", "Id"); cbb.SelectedValue = 0; } } } metroSearchComboBox2.SelectedValueChanged += metroSearchComboBox2_SelectedValueChanged; metroSearchComboBox3.SelectedValueChanged += metroSearchComboBox3_SelectedValueChanged; metroSearchComboBox4.SelectedValueChanged += metroSearchComboBox4_SelectedValueChanged; metroSearchComboBox5.SelectedValueChanged += metroSearchComboBox5_SelectedValueChanged; metroSearchComboBox6.SelectedValueChanged += metroSearchComboBox6_SelectedValueChanged; metroSearchComboBox7.SelectedValueChanged += metroSearchComboBox7_SelectedValueChanged; metroSearchComboBox8.SelectedValueChanged += metroSearchComboBox8_SelectedValueChanged; metroSearchComboBox9.SelectedValueChanged += metroSearchComboBox9_SelectedValueChanged; metroSearchComboBox10.SelectedValueChanged += metroSearchComboBox10_SelectedValueChanged; metroSearchComboBox11.SelectedValueChanged += metroSearchComboBox11_SelectedValueChanged; metroSearchComboBox12.SelectedValueChanged += metroSearchComboBox12_SelectedValueChanged; metroSearchComboBox13.SelectedValueChanged += metroSearchComboBox13_SelectedValueChanged; metroSearchComboBox14.SelectedValueChanged += metroSearchComboBox14_SelectedValueChanged; metroSearchComboBox15.SelectedValueChanged += metroSearchComboBox15_SelectedValueChanged; metroSearchComboBox17.SelectedValueChanged += metroSearchComboBox17_SelectedValueChanged; metroSearchComboBox18.SelectedValueChanged += metroSearchComboBox18_SelectedValueChanged; metroSearchComboBox20.SelectedValueChanged += metroSearchComboBox20_SelectedValueChanged; metroSearchComboBox21.SelectedValueChanged += metroSearchComboBox21_SelectedValueChanged; //metroSearchComboBox2.Text = m_QuotationDetail.ClassSafety; CoverObjectUtility.SetAutoBindingData(this, m_QuotationDetail); } }
public FrmViewSupplier() { InitializeComponent(); gridUtility = new GridUtility(gridControl1); ComboboxUtility.BindSupplierWidthALl(cbSupplier); cbSupplier.SelectedValue = 100; ComboboxUtility.BindGroupPartWidthALl(cbGroupPart); cbGroupPart.SelectedValue = 0; ComboboxUtility.BindTypePartWidthALl(cbTypePart, cbGroupPart.SelectedValue.ToString()); cbTypePart.SelectedValue = 0; ComboboxUtility.BindSeriesParttWidthALl(cbSeriesPart, cbTypePart.SelectedValue.ToString()); cbSeriesPart.SelectedValue = 0; ComboboxUtility.BindParttWidthALl(cbPart, cbSeriesPart.SelectedValue.ToString()); cbPart.SelectedValue = 0; Dock = DockStyle.Fill; //FormUtility.LoadEventCommonControl(this); }
private void cbbDepartment_SelectedIndexChanged(object sender, EventArgs e) { if (cbbDepartment.SelectedValue != null) { IList <Staff> staff = new List <Staff>(); try { using (IUnitOfWork uow = new UnitOfWork()) { staff = uow.StaffRepository.FindByDepartment(Convert.ToInt32(cbbDepartment.SelectedValue)); uow.Commit(); } } catch { } ComboboxUtility.BindData(cbbStaff, staff, "StaffName", "StaffId"); } }
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); }
private void frmSelectProperty_Load(object sender, EventArgs e) { InititalizeForm(m_Company); InititalizeForm(m_Product); //PictureUtility.BindImage(ptPicture, m_Product.PhotoPath); using (IUnitOfWork uow = new UnitOfWork()) { List <ProductPicture> lstPicture = uow.ProductPictureRepository.FindByProduct(m_Product); displayMultiplePicture1.ImgList = new string[5]; displayMultiplePicture1.Show(lstPicture); foreach (Control c in Controls) { if (c is MetroSearchComboBox) { MetroSearchComboBox cbb = c as MetroSearchComboBox; if (cbb.Tag != null) { IList <CustomModel.ProductProperty> lstProperty = uow.ProductRepository.getProperty(cbb.Tag.ToString(), m_Product); ComboboxUtility.BindData <CustomModel.ProductProperty>(cbb, lstProperty, "Value", "Id"); cbb.SelectedValue = 0; } } } //if (m_Product != null && m_Quotation != null) //{ // m_Product = uow.ProductRepository.Find(m_Product.ProductId); // m_QuotationDetail = uow.QuotationDetailRepository.Find(m_Quotation, m_Product); // IList<Model.QuotationDetail> lstQuotationDetail = new List<Model.QuotationDetail>(); // if (m_QuotationDetail == null) // { // m_QuotationDetail = new Model.QuotationDetail(); // } // m_QuotationDetail.Product = m_Product; // InitializeForm(m_QuotationDetail); // lstQuotationDetail.Add(m_QuotationDetail); // richTextBox1.Text = ProductUtility.ConvertToDescription<Model.QuotationDetail>(m_QuotationDetail,UtilityFunction.objectToDescriptionIgnore); // //GridUtility.BindingData<Model.QuotationDetail>( lstQuotationDetail); // if (m_Quotation.Company.Class == null) m_Quotation.Company.Class = new Model.CustomerClass(); // txtPrice.Text = CurrencyUtility.DecimalToString(m_Product.Price); // txtRate.Text = m_Quotation.Company.Class!=null?m_Quotation.Company.Class.ClassRate.ToString():"0"; // txtQuotationPrice.Text = CurrencyUtility.DecimalToString(m_Product.Price * (decimal)m_Quotation.Company.Class.ClassRate); // txtThanhtien.Text = CurrencyUtility.DecimalToString(Convert.ToInt32(txtQuantity.Text) * CurrencyUtility.ToDecimal(txtQuotationPrice.Text)); //} } }
private void frmEditStaff_Load(object sender, EventArgs e) { IList <Department> lstDepartment; IList <UserGroup> lstUserGroup; IList <StaffPosition> lstStaffPosition; using (IUnitOfWork uow = new UnitOfWork()) { lstDepartment = uow.DepartmentRepository.All(); lstUserGroup = uow.UserGroupRepository.All(); lstStaffPosition = uow.StaffPositionRepository.All(); uow.Commit(); } ComboboxUtility.BindData(cbbDepartment, lstDepartment, "DepartmentName", "DepartmentId"); ComboboxUtility.BindData(cbbUserGroup, lstUserGroup, "UserGroupName", "UserGroupId"); ComboboxUtility.BindData(cbbPosition, lstStaffPosition, "StaffPositionName", "StaffPositionId"); InitializeForm(m_Staff); }
private void frmCreateDepartment_Load(object sender, EventArgs e) { labelNotify1.Text = ""; IList <Staff> lstStaff; try { using (IUnitOfWork uow = new UnitOfWork()) { lstStaff = uow.StaffRepository.All(); uow.Commit(); } ComboboxUtility.BindData <Staff>(cbbStaff, lstStaff, "StaffName", "StaffId"); cbbStaff.SelectedValue = -1; } catch (Exception) { } }
private void BindCbbData(IUnitOfWork uow, Control ctrols) { foreach (Control c in ctrols.Controls) { if (c is MetroSearchComboBox) { MetroSearchComboBox cbb = c as MetroSearchComboBox; if (cbb.Tag != null) { IList <CustomModel.ProductProperty> lstProperty = uow.ProductRepository.getProperty(cbb.Tag.ToString(), m_Product); ComboboxUtility.BindData <CustomModel.ProductProperty>(cbb, lstProperty, "Value", "Id"); cbb.SelectedValue = 0; } } if (c.HasChildren) { BindCbbData(uow, c); } } }
private void frmCreateProject_Load(object sender, EventArgs e) { IList <Staff> lstSt = new List <Staff>(); IList <Company> lstCom = new List <Company>(); IList <Status> lstSta = new List <Status>(); using (IUnitOfWork uow = new UnitOfWork()) { lstSt = uow.StaffRepository.All(); lstCom = uow.CompanyRepository.All(); lstSta = uow.ProjectBaseRepository.GetAllStatus(); uow.Commit(); } ComboboxUtility.BindData(cbbSale, lstSt, "StaffName", "StaffId"); ComboboxUtility.BindData(cbbCompany, lstCom, "CompanyName", "CompanyId"); ComboboxUtility.BindData(cbbStatus, lstSta, "StatusName", "StatusId"); cbbSale.SelectedValue = -1; cbbStatus.SelectedValue = -1; labelNotify1.Text = ""; }
private void frmImportMaterialDetail_Load(object sender, EventArgs e) { IList <Model.Material> lstMat = new List <Model.Material>(); try { using (IUnitOfWork uow = new UnitOfWork()) { lstMat = uow.MaterialRepository.GetAllForComboBox(); lstDetail = uow.ImportMaterialDetailRepository.All(import.ImportId); uow.Commit(); } ComboboxUtility.BindMaterialToRepositoryItemLookUpEdit(cbbMaterialCode, lstMat, "MaterialId", "MaterialCode", "MaterialCode"); gridutility.BindingData(lstDetail); LoadData(import); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void frmCreateImportMaterial_Load(object sender, EventArgs e) { IList <Stock> lstStock = new List <Stock>(); try { using (IUnitOfWork uow = new UnitOfWork()) { lstStock = uow.StockRepository.GetAll(); //uow.ImportMaterialRepository. } } catch { } ComboboxUtility.BindData(cbbStock, lstStock, "StockName", "StockId"); gridutility.BindingData(listImportMaterialDetail); labelNotify1.Text = string.Empty; }
private void frmEditMaterial_Load(object sender, EventArgs e) { ComboboxUtility.BindSupplier(cbbSupplier); ComboboxUtility.BindGroupPart(cbbGroupPart); ComboboxUtility.BindTypePartWidthALl(cbbTypePart, "0"); ComboboxUtility.BindSeriesParttWidthALl(cbbSeriesPart, "0"); ComboboxUtility.BindUnit(cbbUnit); FormUtility.FormatForm(this); FormUtility.ResetForm(this); if (!materialRequestDataBase.IsEdit) { this.Text = UI.MateralCreateTilteForm; } else { this.Text = UI.MateralEditTilteForm; } InititalizeForm(m_Material); }
private void createSourcingToolStripMenuItem_Click(object sender, EventArgs e) { TreeTagPart treetag = treeView1.SelectedNode.Tag as TreeTagPart; mainCreate = treetag; if (treetag != null) { isCreateNew.SeriesPartID = treetag.SeriesPartIDTag; } txtNamePart.Tag = txtNamePart.Text; objBackUp = new PartBackUp(); objBackUp.PartName = txtNamePart.Text; objBackUp.Description = txtDescription.Text; objBackUp.PartName = txtNumberPart.Text; objBackUp.Pricespart = txtPricePart.Text != string.Empty ? decimal.Parse(txtPricePart.Text) : 0; objBackUp.ImagePath = PictureImage.Tag != null?PictureImage.Tag.ToString() : null; objBackUp.ImagePath = currentImagePath; PictureUtility.BindImage(PictureImage, "@32121"); txtNamePart.Text = string.Empty; txtDescription.Text = string.Empty; txtNumberPart.Text = string.Empty; txtPricePart.Text = string.Empty; PictureImage.InitialImage = null; ComboboxUtility.BindSupplier(cboSupplier); lbTitle.Text = "Create new sourcing"; isInsert = true; isUpdate = false; txtPricePart.ReadOnly = false; txtNamePart.ReadOnly = false; txtDescription.ReadOnly = false; cboSupplier.Enabled = true; txtNumberPart.ReadOnly = false; }