public ForecastForm() { InitializeComponent(); //DataUsageEnum.DATA_USAGE1.Description foreach (DataUsageEnum val in Enum.GetValues(typeof(DataUsageEnum))) { ComboboxItem item = new ComboboxItem(); item.Text = val.Description(); item.Value = val; comStatus.Items.Add(item); } //comStatus.Items.AddRange(Enum.GetNames(typeof(DataUsageEnum))); comStatus.Items.Insert(0, "--Select Here--"); comStatus.SelectedIndex = 0; comMethodologey.Items.AddRange(Enum.GetNames(typeof(MethodologyEnum))); comMethodologey.Items.Insert(0, "--Select Here--"); comMethodologey.SelectedIndex = 0; cboRegressionType.Items.AddRange(Enum.GetNames(typeof(ForecastingMethodEnum))); cboRegressionType.SelectedIndex = 0; cboOrder.SelectedIndex = 0; PopForecastInfo(); _forecastInfo = LqtUtil.GetComboBoxValue<ForecastInfo>(comForecastinfo); }
private void Form1_Load(object sender, EventArgs e) { EncodingInfo[] encoodingList = Encoding.GetEncodings(); foreach (EncodingInfo encoding in encoodingList) { ComboboxItem item = new ComboboxItem(); item.Text = encoding.Name +" - "+ encoding.DisplayName ; item.Value = encoding.CodePage; cboEncoding.Items.Add(item); } }
private void fillCMB() { for(int x = 1; x < 5; x++) { ComboboxItem cbItem = new ComboboxItem(); cbItem.Text = x.ToString(); cbItem.Value = x.ToString(); cmbStartPage.Items.Add(cbItem); } cmbStartPage.SelectedIndex = 0; }
public BuyWindow() { InitializeComponent(); WorkWithDatabase work = new WorkWithDatabase(); var dbDataReader = work.selectProducts(); ArrayList allProducts = new ArrayList(); while (dbDataReader.Read()) { ComboboxItem item = new ComboboxItem(); item.Text = dbDataReader["PRODUCT_NAME"].ToString(); productsCombo.Items.Add(item); } dbDataReader.Close(); }
private void buttonClose_Click(object sender, EventArgs e) { if(global.connectDb && textBoxDataSourceName.Text.Length>0) { ComboboxItem cbi = new ComboboxItem(textBoxDataSourceName.Text, global.connectionString); List<ComboboxItem> cbiList = ApplicationUtil.getDestDataSources(); cbiList.Add(cbi); ApplicationUtil.setDestDataSources(cbiList); AddDestDataSource.ActiveForm.Close(); } else { MessageBox.Show("Invalid datasource plase check again"); } }
private void Aventure_Load(object sender, EventArgs e) { cboChoisirAventure.Items.Clear(); ComboboxItem cbAventure; int niveauGroupe = p.groupeAventurier.PlusHautNiveau(); foreach (Aventure aventure in la.ListeAventures) { if (niveauGroupe >= aventure.NiveauRequis) { cbAventure = new ComboboxItem(); cbAventure.Text = aventure.NomAventure + " (" + aventure.NiveauAventure + ")"; cbAventure.Value = aventure.IdAventure; cboChoisirAventure.Items.Add(cbAventure); } } }
public void cargarComboTipoServicio() { Conexion cn = new Conexion(); SqlDataReader consulta = cn.consultar("SELECT ID_TIPO_SERVICIO, DESCRIPCION FROM SASHAILO.Tipo_Servicio order by 2"); while (consulta.Read()) { int id = consulta.GetInt32(0); string descripcion = consulta.GetString(1); ComboboxItem item = new ComboboxItem(); item.Text = descripcion; item.Value = id; tipo_servicio.Items.Add(item); } cn.desconectar(); }
public void cargarCombosCiudad() { Conexion cn = new Conexion(); SqlDataReader consulta = cn.consultar("SELECT ID_CIUDAD, NOMBRE_CIUDAD FROM SASHAILO.Ciudad WHERE HABILITADA = 'S' order by 2"); while (consulta.Read()) { int id_ciudad = consulta.GetInt32(0); string d_ciudad = consulta.GetString(1); ComboboxItem item = new ComboboxItem(); item.Text = d_ciudad; item.Value = id_ciudad; origen.Items.Add(item); destino.Items.Add(item); } cn.desconectar(); }
private void Form1_Load(object sender, EventArgs e) { //MySqlDataReader d = Mysql.query.select("SELECT * FROM web_usuarios_ limit 3"); //while ( Mysql.query.leer(d) ) //{ // MessageBox.Show("multiple " + d["user_nombre"]); //} //MessageBox.Show("bool " + Mysql.query.update("update prueba set numero = '6000' where id = '6' ") ); //MessageBox.Show("num " + Mysql.query.insert("INSERT INTO prueba (nombre,numero) VALUES ('cholo8888',8888);") ); //MessageBox.Show("delete bool " + Mysql.query.delete("DELETE FROM prueba WHERE id = 3")); //MessageBox.Show("count " + Mysql.query.count("SELECT * FROM prueba")); d = Mysql.query.select("SELECT * FROM web_usuarios"); while ( Mysql.query.leer(d) ) { ComboboxItem item = new ComboboxItem(); item.Text = "" + d["user_nombre"]; item.Value = d["user_id"]; usuarios.Items.Add(item); } }
public void llenaComboProducto() { Conexion cn = new Conexion(); producto.Items.Clear(); SqlDataReader consulta = cn.consultar("select ID_PRODUCTO, DESCRIPCION, PUNTOS_NECESARIOS from SASHAILO.Producto WHERE STOCK > 0 ORDER BY 3 desc"); while (consulta.Read()) { int id_producto = consulta.GetInt32(0); string desc = consulta.GetString(1); int puntos_necesarios = consulta.GetInt32(2); ComboboxItem item = new ComboboxItem(); item.Text = desc; item.Value = id_producto; item.Puntos = puntos_necesarios; producto.Items.Add(item); } cn.desconectar(); producto.Text = ""; }
public static List<ComboboxItem> GetGenericItems() { List<ComboboxItem> items = new List<ComboboxItem>(); OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("../App_Data/combobox.mdb")); myConn.Open(); OleDbCommand myComm = new OleDbCommand("SELECT * FROM combobox", myConn); OleDbDataReader myReader = myComm.ExecuteReader(CommandBehavior.Default); while (myReader.Read()) { ComboboxItem item = new ComboboxItem(); item.Text = myReader.GetString(myReader.GetOrdinal("text")); item.Value = myReader.GetInt32(myReader.GetOrdinal("value")).ToString(); items.Add(item); } myReader.Close(); myConn.Close(); return items; }
private void cargarComboListados() { int nro_listado = 1; string d_listado = "Destinos con más pasajes comprados"; ComboboxItem item = new ComboboxItem(); item.Text = d_listado; item.Value = nro_listado; combo_listados.Items.Add(item); nro_listado = 2; d_listado = "Destinos con micros más vacíos"; item = new ComboboxItem(); item.Text = d_listado; item.Value = nro_listado; combo_listados.Items.Add(item); nro_listado = 3; d_listado = "Clientes con más puntos acumulados a la fecha"; item = new ComboboxItem(); item.Text = d_listado; item.Value = nro_listado; combo_listados.Items.Add(item); nro_listado = 4; d_listado = "Destinos con pasajes cancelados"; item = new ComboboxItem(); item.Text = d_listado; item.Value = nro_listado; combo_listados.Items.Add(item); nro_listado = 5; d_listado = "Micros con mayor cantidad de días fuera de servicio"; item = new ComboboxItem(); item.Text = d_listado; item.Value = nro_listado; combo_listados.Items.Add(item); }
private void Button_AddToCart_Click(object sender, RoutedEventArgs e) { if (!amountToBuy.Text.Equals("")) { WorkWithDatabase work = new WorkWithDatabase(); SQLiteDataReader dbDataReader = work.selectProducts(); ArrayList allProducts = new ArrayList(); while (dbDataReader.Read()) { allProducts.Add(new Product(dbDataReader["PRODUCT_NAME"].ToString(), Convert.ToDouble(dbDataReader["PRODUCT_PRICE"]), false)); } string selectedProduct = productsCombo.Text; foreach (Product item in allProducts) { int amount = 0; if (selectedProduct.Equals(item.Name)) { amount = Convert.ToInt32(amountToBuy.Text); for (int i = 0; i < amount; i++) { purchasedProducts.Add(new Product(item.Name, item.Price, false)); } totalPrice += item.Price * amount; purchazedProductsCobmoBox.Items.Clear(); foreach (Product prod in purchasedProducts) { ComboboxItem comboItem = new ComboboxItem(); comboItem.Text = prod.Name; if (prod.HasDiscount == false) { purchazedProductsCobmoBox.Items.Add(comboItem); } } } } productInfo.Text = "Total price " + totalPrice.ToString(); amountInTheCart += Convert.ToInt32(amountToBuy.Text); productsInTheCart.Text = "Products in the cart: " + amountInTheCart.ToString(); } else { MessageBox.Show("Enter Amount"); } }
private void getDiscount_Click(object sender, RoutedEventArgs e) { if (!numberOfCoupon.Text.Equals("")) { if (!purchazedProductsCobmoBox.Text.Equals("")) { WorkWithDatabase work = new WorkWithDatabase(); double discount = 0; string couponType = ""; SQLiteDataReader couponnReader = work.selectCoupon(Convert.ToInt32(numberOfCoupon.Text)); if (couponnReader.HasRows) { couponnReader.Read(); discount = Convert.ToDouble(couponnReader["COUPON_DISCOUNT"]); couponType = couponnReader["COUPON_TYPE"].ToString(); couponnReader.Close(); } else { MessageBox.Show("Coupon not found"); } SQLiteDataReader lowerPriceLimitReader = work.selectLowerPrice(); lowerPriceLimitReader.Read(); double lowerPriceLimit = Convert.ToInt32(lowerPriceLimitReader["PRICE_LIMIT"]); lowerPriceLimitReader.Close(); SQLiteDataReader productForDiscount = work.selectOneProduct(purchazedProductsCobmoBox.Text); productForDiscount.Read(); double discountProductPrice = Convert.ToDouble(productForDiscount["PRODUCT_PRICE"]); int enteredCouponNumber = Convert.ToInt32(numberOfCoupon.Text); productForDiscount.Close(); WorkWithCoupons couponsWork = new WorkWithCoupons(); string productForDiscountCombo = purchazedProductsCobmoBox.Text; switch (couponType) { case "All Products": { int myInd; double totalPrice1 = couponsWork.getDiscount(purchasedProducts, totalPrice, discountProductPrice, discount, productForDiscountCombo, out myInd); //totalPrice = totalPrice - discountProductPrice * (discount / 100); totalPrice = totalPrice1; productInfo.Text = "Total price " + totalPrice.ToString(); /* Product[] prArray = purchasedProducts.ToArray<Product>(); int myIndex = 0; for (int i = 0; i < prArray.Length; i++) { if (prArray[i].Name == purchazedProductsCobmoBox.Text) { myIndex = i - 1; } }*/ int myIndex = myInd; purchasedProducts.RemoveAt(myIndex); purchazedProductsCobmoBox.Items.Clear(); foreach (Product prod in purchasedProducts) { ComboboxItem comboItem = new ComboboxItem(); comboItem.Text = prod.Name; if (prod.HasDiscount == false) { purchazedProductsCobmoBox.Items.Add(comboItem); } } work.deleteCoupon(Convert.ToInt32(numberOfCoupon.Text)); numberOfCoupon.Text = ""; } break; case "Lower Price": { if (discountProductPrice <= lowerPriceLimit) { int myInd; double totalPrice1 = couponsWork.getDiscount(purchasedProducts, totalPrice, discountProductPrice, discount, productForDiscountCombo, out myInd); totalPrice = totalPrice1; productInfo.Text = "Total price " + totalPrice.ToString(); int myIndex = myInd; purchasedProducts.RemoveAt(myIndex); purchazedProductsCobmoBox.Items.Clear(); foreach (Product prod in purchasedProducts) { ComboboxItem comboItem = new ComboboxItem(); comboItem.Text = prod.Name; if (prod.HasDiscount == false) { purchazedProductsCobmoBox.Items.Add(comboItem); } } work.deleteCoupon(Convert.ToInt32(numberOfCoupon.Text)); numberOfCoupon.Text = ""; } else { MessageBox.Show("Coupon doesn`t fay!"); } } break; case "Higher Price": { if (discountProductPrice > lowerPriceLimit) { int myInd; double totalPrice1 = couponsWork.getDiscount(purchasedProducts, totalPrice, discountProductPrice, discount, productForDiscountCombo, out myInd); totalPrice = totalPrice1; productInfo.Text = "Total price " + totalPrice.ToString(); int myIndex = myInd; purchasedProducts.RemoveAt(myIndex); purchazedProductsCobmoBox.Items.Clear(); foreach (Product prod in purchasedProducts) { ComboboxItem comboItem = new ComboboxItem(); comboItem.Text = prod.Name; if (prod.HasDiscount == false) { purchazedProductsCobmoBox.Items.Add(comboItem); } } work.deleteCoupon(Convert.ToInt32(numberOfCoupon.Text)); numberOfCoupon.Text = ""; } else { MessageBox.Show("Coupon doesn`t fay!"); } } break; default: break; } } else { MessageBox.Show("Select product for discount"); } } else { MessageBox.Show("Coupon not entered!"); } }
private void llenarComboTipoServicio(ComboBox cb) { Conexion cn = new Conexion(); SqlDataReader consulta = cn.consultar("select ID_TIPO_SERVICIO, DESCRIPCION from SASHAILO.Tipo_Servicio order by 2"); while (consulta.Read()) { int id_tipo_servicio = consulta.GetInt32(0); string d_servicio = consulta.GetString(1); ComboboxItem item = new ComboboxItem(); item.Text = d_servicio; item.Value = id_tipo_servicio; cb.Items.Add(item); } cn.desconectar(); }
private void llenarComboPisos(ComboBox cb) { ComboboxItem item = new ComboboxItem(); item.Text = "1"; item.Value = 1; ComboboxItem item2 = new ComboboxItem(); item2.Text = "2"; item2.Value = 2; cb.Items.Add(item); cb.Items.Add(item2); }
private void n_tarjeta_Leave(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); sb.Append("select tt.CUOTAS "); sb.Append("from SASHAILO.Tarjeta_Credito ta join SASHAILO.Tipo_Tarjeta tt on tt.ID_TIPO_TARJETA = ta.ID_TIPO_TARJETA "); sb.Append("where ta.NRO_TARJETA = '"+ n_tarjeta.Text.Trim() +"'"); Conexion cn = new Conexion(); SqlDataReader consulta = cn.consultar(sb.ToString()); c_cuotas.Items.Clear(); if (consulta.Read()) //existe el cliente ingresado { int v_cuotas = consulta.GetInt32(0); for (int i = 1; i <= v_cuotas; i++ ) { int c_cuota = i; string d_cuota = i.ToString(); ComboboxItem item = new ComboboxItem(); item.Text = d_cuota; item.Value = c_cuota; c_cuotas.Items.Add(item); } } else { int c_cuota = 1; string d_cuota = "1"; ComboboxItem item = new ComboboxItem(); item.Text = d_cuota; item.Value = c_cuota; c_cuotas.Items.Add(item); } cn.desconectar(); }
private void cargarCombosSexo() { int c_sexo_m = 0; string d_sexo_m = "M"; int c_sexo_f = 1; string d_sexo_f = "F"; ComboboxItem item_m = new ComboboxItem(); item_m.Text = d_sexo_m; item_m.Value = c_sexo_m; ComboboxItem item_f = new ComboboxItem(); item_f.Text = d_sexo_f; item_f.Value = c_sexo_f; combo_sexo.Items.Add(item_m); combo_sexo.Items.Add(item_f); }
private void RefreshListNameOrder() { int count = listNameOrder.Count(); ContactNameOrderDB nameOrder; combobox_name.Items.Clear(); for (int i = 0; i < count; i++) { nameOrder = listNameOrder[i]; ComboboxItem item = new ComboboxItem(); int nameOrderId = nameOrder.Id; item.Value = nameOrderId; item.Text = nameOrder.NameOrder; combobox_name.Items.Add(item); if (nameOrderId == hostNameOrder.ContactNameOrderId) { combobox_name.SelectedIndex = i; } } }
/// <summary> /// Init lists /// </summary> private void initLists() { int intCount = 0; this.cmbLevel.DisplayMember = "Text"; this.cmbLevel.ValueMember = "Value"; cmbLevel.Items.Clear(); cmbTime.Items.Clear(); for (intCount = 0; intCount < 12; intCount++) { StringBuilder strText = new StringBuilder(); StringBuilder strTimeText = new StringBuilder(); // Level object strText.Append(intCount.ToString()); if (intCount == 0) { strText.Append(" (easiest)"); } if (intCount == 11) { strText.Append(" (hardest)"); } ComboboxItem cmbItem = new ComboboxItem(); cmbItem.Text = strText.ToString(); cmbItem.Value = intCount.ToString(); cmbLevel.Items.Add(cmbItem); // Time object ComboboxItem cmbItemTime = new ComboboxItem(); try { if (intCount > 0) { int intTemp = 120 / intCount; cmbItemTime.Value = intTemp; } else { cmbItemTime.Value = 120; } strTimeText.Append(cmbItemTime.Value.ToString()); strTimeText.Append(" seconds"); } catch (Exception) { cmbItemTime.Value = 65535; } cmbItemTime.Text = strTimeText.ToString(); cmbTime.Items.Add(cmbItemTime); cmbAnswer.Items.Clear(); ComboboxItem cmbAA = new ComboboxItem(); cmbAA.Text = "A"; cmbAA.Value = "A"; ComboboxItem cmbAB = new ComboboxItem(); cmbAB.Text = "B"; cmbAB.Value = "B"; ComboboxItem cmbAC = new ComboboxItem(); cmbAC.Text = "C"; cmbAC.Value = "C"; ComboboxItem cmbAD = new ComboboxItem(); cmbAD.Text = "D"; cmbAD.Value = "D"; cmbAnswer.Items.Add(cmbAA); cmbAnswer.Items.Add(cmbAB); cmbAnswer.Items.Add(cmbAC); cmbAnswer.Items.Add(cmbAD); } }
private void Populate_ComboBox_ConditionSelection() { foreach (var condition in Enum.GetValues(typeof(ConditionType)).Cast<ConditionType>().OrderBy(x => x.ToString()).ToList()) { ComboboxItem NewItem = new ComboboxItem(); NewItem.Text = condition.ToString(); NewItem.Value = condition; CB_ConditionSelection.Items.Add(NewItem); } CB_ConditionSelection.SelectedIndex = 0; }
private void RefreshListFaxType() { int count = listFaxType.Count(); FaxTypeDB type; combobox_fax.Items.Clear(); for (int i = 0; i < count; i++) { type = listFaxType[i]; ComboboxItem item = new ComboboxItem(); item.Value = i; item.Text = type.Name; combobox_fax.Items.Add(item); if (type.IsPreferred) { combobox_fax.SelectedIndex = i; } } }
private void CB_PowerSelection_SelectedIndexChanged(object sender, EventArgs e) { ComboboxItem SelectedItem = CB_PowerSelection.SelectedItem as ComboboxItem; if (SelectedItem != null) { SkillPower Power = SelectedItem.Value as SkillPower; CB_SelectedRune.Items.Clear(); foreach (var rune in Power.Runes) { ComboboxItem NewItem = new ComboboxItem(); NewItem.Text = rune.Name; NewItem.Value = rune; CB_SelectedRune.Items.Add(NewItem); } CB_SelectedRune.SelectedIndex = 0; CB_PowerSelection.Update(); } }
private void cargarComboTipoPago() { int c_tipo_m = 1; string d_tipo_m = "Efectivo"; int c_tipo_f = 2; string d_tipo_f = "Tarjeta de Crédito"; ComboboxItem item_m = new ComboboxItem(); item_m.Text = d_tipo_m; item_m.Value = c_tipo_m; ComboboxItem item_f = new ComboboxItem(); item_f.Text = d_tipo_f; item_f.Value = c_tipo_f; c_tipo_pago.Items.Add(item_m); c_tipo_pago.Items.Add(item_f); }
public Form1(IProgramService iProgramService, IScheduleService iScheduleService, ISaleService iSaleService, IReportService iReportService, ILevelService iLevelService, ITimeSettingService iTimeSettingService) { InitializeComponent(); _iProgramService = iProgramService; _iScheduleService = iScheduleService; _iSaleService = iSaleService; _iReportService = iReportService; _iLevelService = iLevelService; _iTimeSettingService = iTimeSettingService; dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker2.Format = DateTimePickerFormat.Custom; dateTimePicker3.Format = DateTimePickerFormat.Custom; dateTimePicker4.Format = DateTimePickerFormat.Custom; dateTimePicker6.Format = DateTimePickerFormat.Custom; dateTimePicker7.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "dd-MM-yyyy"; dateTimePicker1.CustomFormat = "dd-MM-yyyy"; dateTimePicker2.CustomFormat = "dd-MM-yyyy"; dateTimePicker3.CustomFormat = "dd-MM-yyyy"; dateTimePicker4.CustomFormat = "dd-MM-yyyy"; dateTimePicker6.CustomFormat = "dd-MM-yyyy"; dateTimePicker7.CustomFormat = "dd-MM-yyyy"; dateTimePicker5.Format = DateTimePickerFormat.Time; dateTimePicker5.ShowUpDown = true; var all = _iProgramService.GetAll().ToList(); start = DateTime.Today; end = DateTime.Today; reportStart = DateTime.Today; reportEnd = DateTime.Today; culture = new System.Globalization.CultureInfo("fr-FR", true); var levelList = _iLevelService.GetAll().ToList(); var a = levelList.Where(x => x.Name == "A").OrderByDescending(x=>x.UpdateDate).FirstOrDefault(); if (a != null && a.Begin.HasValue) { textBox4.Text = a.Begin.Value.ToString("N", CultureInfo.CreateSpecificCulture("en-US")); textBox7.Text = a.End.Value.ToString("N", CultureInfo.CreateSpecificCulture("en-US")); var b = levelList.Where(x => x.Name == "B").OrderByDescending(x => x.UpdateDate).FirstOrDefault(); textBox5.Text = b.Begin.Value.ToString("N", CultureInfo.CreateSpecificCulture("en-US")); textBox8.Text = b.End.Value.ToString("N", CultureInfo.CreateSpecificCulture("en-US")); var c = levelList.Where(x => x.Name == "C").OrderByDescending(x => x.UpdateDate).FirstOrDefault(); textBox6.Text = c.Begin.Value.ToString("N", CultureInfo.CreateSpecificCulture("en-US")); textBox9.Text = c.End.Value.ToString("N", CultureInfo.CreateSpecificCulture("en-US")); } var timesetting = _iTimeSettingService.GetAll().OrderByDescending(x=>x.UpdateDate).FirstOrDefault(); if (timesetting != null) { dateTimePicker5.Value = timesetting.time; } else { dateTimePicker5.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 0, 0); } changeTimeGraph(); ComboboxItem item1 = new ComboboxItem(); item1.Text = "Quantity"; item1.Value = 1; ComboboxItem item2 = new ComboboxItem(); item2.Text = "Efficiency"; item2.Value = 2; comboBox1.Items.Add(item1); comboBox1.Items.Add(item2); comboBox1.SelectedIndex = 0; mode = 1; }
private void llenarComboMarca() { Conexion cn = new Conexion(); SqlDataReader consulta = cn.consultar("select ID_MARCA, DESCRIPCION from SASHAILO.Marca_Micro order by 2"); while (consulta.Read()) { int id = consulta.GetInt32(0); string descripcion = consulta.GetString(1); ComboboxItem item = new ComboboxItem(); item.Text = descripcion; item.Value = id; combo_marca.Items.Add(item); } cn.desconectar(); }
public frmIntroduceFriendReferral(int aEmployeeID,string CurrentMembershipID,MemberRecord aMemberRecord, ACMSLogic.User oUser, string aStrTerminalBranchCode) { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // myEmployeeIDLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.TherapistForPOSSalesLookupEditBuilder(lkpEdtSalesPersonID.Properties, aStrTerminalBranchCode); TblReceiptFreebie Freebie = new TblReceiptFreebie(); DataTable FreebieTable = Freebie.SelectIntro5FriendFreebie(); new XtraUtils.LookupEditBuilder.FriendPromotionLookupEditBuilder(FreebieTable, lkFreebie.Properties); TblReceiptFreebie Freebie2 = new TblReceiptFreebie(); DataTable FreebieTable2 = Freebie.SelectIntro10FriendFreebie(); new XtraUtils.LookupEditBuilder.FriendPromotionLookupEditBuilder(FreebieTable2, lkFreebie2.Properties); TblRewards rewards4 = new TblRewards(); DataTable rewards4Table = rewards4.SelectRewardsForReferral(4, aStrTerminalBranchCode); new XtraUtils.LookupEditBuilder.LoyalPointsLookupEditBuilder(rewards4Table, ddl4Friends.Properties); TblRewards rewards8 = new TblRewards(); DataTable rewards8Table = rewards8.SelectRewardsForReferral(8, aStrTerminalBranchCode); new XtraUtils.LookupEditBuilder.LoyalPointsLookupEditBuilder(rewards8Table, ddl8Friends.Properties); strMembershipID = CurrentMembershipID; strTerminalBranchCode = aStrTerminalBranchCode; employeeID = aEmployeeID; myMemberRecord = aMemberRecord; myUser = oUser; ucNonMemberID1.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID2.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID3.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID4.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID5.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID6.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID7.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID8.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID9.StrBranchCode = aStrTerminalBranchCode; ucNonMemberID10.StrBranchCode = aStrTerminalBranchCode; TblPromotionIntroFriends sqlPromotionIntroFriends = new TblPromotionIntroFriends(); DataTable PromotionIntroFriends = sqlPromotionIntroFriends.SelectAllPromotionIntroFriends(strMembershipID); myContacts = new Contacts(); if (PromotionIntroFriends.Rows.Count > 0) { txtSerialNo.Text = PromotionIntroFriends.Rows[0]["strSerialNo"].ToString(); chkIssued.Checked = (PromotionIntroFriends.Rows[0]["fIssued"] == DBNull.Value || PromotionIntroFriends.Rows[0]["fIssued"].ToString() == "False" ? false : true); ucNonMemberID1.EditValue = PromotionIntroFriends.Rows[0]["strFriendID01"].ToString(); ucNonMemberID1.Enabled = (ucNonMemberID1.EditValue == ""); ucNonMemberID2.EditValue = PromotionIntroFriends.Rows[0]["strFriendID02"].ToString(); ucNonMemberID2.Enabled = (ucNonMemberID2.EditValue == ""); ucNonMemberID3.EditValue = PromotionIntroFriends.Rows[0]["strFriendID03"].ToString(); ucNonMemberID3.Enabled = (ucNonMemberID3.EditValue == ""); ucNonMemberID4.EditValue = PromotionIntroFriends.Rows[0]["strFriendID04"].ToString(); ucNonMemberID4.Enabled = (ucNonMemberID4.EditValue == ""); ucNonMemberID5.EditValue = PromotionIntroFriends.Rows[0]["strFriendID05"].ToString(); ucNonMemberID5.Enabled = (ucNonMemberID5.EditValue == ""); ucNonMemberID6.EditValue = PromotionIntroFriends.Rows[0]["strFriendID05"].ToString(); ucNonMemberID6.Enabled = (ucNonMemberID6.EditValue == ""); ucNonMemberID7.EditValue = PromotionIntroFriends.Rows[0]["strFriendID05"].ToString(); ucNonMemberID7.Enabled = (ucNonMemberID7.EditValue == ""); ucNonMemberID8.EditValue = PromotionIntroFriends.Rows[0]["strFriendID05"].ToString(); ucNonMemberID8.Enabled = (ucNonMemberID8.EditValue == ""); ucNonMemberID9.EditValue = PromotionIntroFriends.Rows[0]["strFriendID05"].ToString(); ucNonMemberID9.Enabled = (ucNonMemberID9.EditValue == ""); ucNonMemberID10.EditValue = PromotionIntroFriends.Rows[0]["strFriendID05"].ToString(); ucNonMemberID10.Enabled = (ucNonMemberID10.EditValue == ""); lkFreebie.EditValue = PromotionIntroFriends.Rows[0]["strFreebieCode"].ToString(); } //if (ACMS.Convert.ToInt32(PromotionIntroFriends.Rows[0]["nMaxSession"]) == 9999) // needtoAddBackOneDayExpiryDate = true; // //DataTable attendedClassTable = classAttendance.GetAllClassAttendancesBasePackageID(wantToUpgrade_nPackageID, pos.StrMembershipID, pos.StrBranchCode); //txtSerialNo.Text = "A1"; //ucNonMemberID1.EditValue = "aa"; ComboboxItem itemFemale = new ComboboxItem(); itemFemale.Text = "Female"; itemFemale.Value = "F"; ComboboxItem itemMale = new ComboboxItem(); itemMale.Text = "Male"; itemMale.Value = "M"; cbGender1.Items.Add(itemFemale); cbGender1.Items.Add(itemMale); cbGender1.SelectedIndex = 0; cbGender2.Items.Add(itemFemale); cbGender2.Items.Add(itemMale); cbGender2.SelectedIndex = 0; cbGender3.Items.Add(itemFemale); cbGender3.Items.Add(itemMale); cbGender3.SelectedIndex = 0; cbGender4.Items.Add(itemFemale); cbGender4.Items.Add(itemMale); cbGender4.SelectedIndex = 0; cbGender5.Items.Add(itemFemale); cbGender5.Items.Add(itemMale); cbGender5.SelectedIndex = 0; cbGender6.Items.Add(itemFemale); cbGender6.Items.Add(itemMale); cbGender6.SelectedIndex = 0; cbGender7.Items.Add(itemFemale); cbGender7.Items.Add(itemMale); cbGender7.SelectedIndex = 0; cbGender8.Items.Add(itemFemale); cbGender8.Items.Add(itemMale); cbGender8.SelectedIndex = 0; }
private void llenarComboTipoButaca(ComboBox cb) { Conexion cn = new Conexion(); SqlDataReader consulta = cn.consultar("SELECT ID_TIPO_BUTACA, DESCRIPCION FROM SASHAILO.Tipo_Butaca order by 2"); while (consulta.Read()) { int id = consulta.GetInt32(0); string desc = consulta.GetString(1); ComboboxItem item = new ComboboxItem(); item.Text = desc; item.Value = id; cb.Items.Add(item); } cn.desconectar(); }
private void rptStockSaleProduct_Load(object sender, EventArgs e) { string get_From_link = DBConnString.sCode; string strConn; strConn = DBConnString.strConn; Conn = new SqlConnection(); if (Conn.State == ConnectionState.Open) { Conn.Close(); } Conn.ConnectionString = strConn; Conn.Open(); // ดึงข้อมูล วัน เดือน ปี ปัจจุบันมาแสดง cbodatestart.Value = DateTime.Today; cbodatestop.Value = DateTime.Today; if (get_From_link == "KTC" || get_From_link == "SHOP") { ComboboxItem item = new ComboboxItem(); item.Text = get_From_link; item.Value = 5; cboBranch.Items.Add(item); cboBranch.Text = get_From_link; cboBranch.Enabled = false; } else { cboBranch.Text = "7Sea_สงขลา"; } //cboBranch.Enabled = false; //if (DBConnString.sCode == "7CSK") //{ // cboBranch.Text = "7Sea_สงขลา"; // cboBranch.Enabled = true; //} //else if (DBConnString.sCode == "7CTR") // cboBranch.Text = "7Sea_ตรัง"; //else if (DBConnString.sCode == "7CTP") // cboBranch.Text = "7Sea_ตะกั่วป่า"; //else if (DBConnString.sCode == "7SEA_TASARA") // cboBranch.Text = "7Sea_ท่าศาลา"; //else if (DBConnString.sCode == "7SEA_HUASAI") // cboBranch.Text = "7Sea_หัวไทร"; Class.Function.LoadDataCate(cmbMainCate, "select MainCateId,MainCateName from MAINCATE", "MainCateId", "MainCateName"); Class.Function.LoadDataCate(cmbSubCate, "select SubCateId,SubCateName from SUBCATE where SubCateId = 0 OR MainCateId = " + cmbMainCate.SelectedValue, "SubCateId", "SubCateName"); }
private void load_data_to_combobox_thanh_pham_va_don_vi_tinh_thanh_pham() { //combobox thanh pham List<ComboboxItem> v_lst_combobox_item_thanh_pham = new List<ComboboxItem>(); var tp = db.DM_VAT_TU_HANG_HOA.Where(x => x.ID == ID_THANH_PHAM).FirstOrDefault(); if (tp == null) return; ComboboxItem item_tp = new ComboboxItem() { Value = tp.ID, Text = tp.TEN_VAT_TU_HANG_HOA }; v_lst_combobox_item_thanh_pham.Add(item_tp); m_cbo_thanh_pham.DisplayMember = "Text"; m_cbo_thanh_pham.ValueMember = "Value"; m_cbo_thanh_pham.DataSource = v_lst_combobox_item_thanh_pham; //combobox don vi tinh thanh pham List<ComboboxItem> v_lst_combobox_item_dvt = new List<ComboboxItem>(); if (tp.DM_DON_VI_TINH != null) { ComboboxItem item_dvt = new ComboboxItem() { Value = tp.DM_DON_VI_TINH.ID, Text = tp.DM_DON_VI_TINH.TEN }; v_lst_combobox_item_dvt.Add(item_dvt); } m_cbo_don_vi_tinh_thanh_pham.DisplayMember = "Text"; m_cbo_don_vi_tinh_thanh_pham.ValueMember = "Value"; m_cbo_don_vi_tinh_thanh_pham.DataSource = v_lst_combobox_item_dvt; }
private void QuanLyDocGia_Load(object sender, EventArgs e) { dateTimePickerfrom.Visible = false; dateTimePickerto.Visible = false; _context = new ThuVienDbContext(); InitializeDataGridView(_context.DocGia.Where(i => i.TinhTrang == 0 || i.TinhTrang == 1).ToList().Select(i => new DocGiaViewModel(i)).ToList()); //combobox category List <ComboboxItem> list_cbb = new List <ComboboxItem> { }; item = new ComboboxItem(); item.Text = "Sinh Viên"; item.Value = (byte)ConstantHandler.Loai_DocGia.SinhVien; list_cbb.Add(item); item = new ComboboxItem(); item.Text = "Giáo Viên"; item.Value = (byte)ConstantHandler.Loai_DocGia.GiaoVien; list_cbb.Add(item); cbb_category.DataSource = list_cbb; cbb_category.DisplayMember = "Text"; cbb_category.ValueMember = "Value"; //combobox category list_cbb = new List <ComboboxItem> { }; item = new ComboboxItem(); item.Text = "Khóa"; item.Value = (byte)ConstantHandler.TinhTrang_DocGia.Khoa; list_cbb.Add(item); item = new ComboboxItem(); item.Text = "Đang sử dụng"; item.Value = (byte)ConstantHandler.TinhTrang_DocGia.Dangsudung; list_cbb.Add(item); cbb_state.DataSource = list_cbb; cbb_state.DisplayMember = "Text"; cbb_state.ValueMember = "Value"; var path = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())); int d = path.LastIndexOf("\\"); path = path.Substring(0, d); pictureBox.Image = new Bitmap(path + @"\\Thu_Vien_MVC\\Content\\Image\\no-avatar.png"); pictureBox.SizeMode = PictureBoxSizeMode.StretchImage; list_cbb = new List <ComboboxItem> { }; for (int i = 1; i < dataGridView1.ColumnCount; i++) { item = new ComboboxItem(); item.Text = dataGridView1.Columns[i].DataPropertyName; item.Value = (byte)i; list_cbb.Add(item); } cbb_column.DataSource = list_cbb; cbb_column.DisplayMember = "Text"; cbb_column.ValueMember = "Value"; }