protected void cmbSearcUser_ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { if (e.Value != null && e.Value.ToString().Trim() != "") { User selected = new User(); ASPxComboBox comboBox = (ASPxComboBox)source; List <User> mrList = new List <User>(); mrList.Add(new UserService().GetFindUser(e.Value.ToString().Trim(), new SessionManager().GetUserId(this.Session))); comboBox.DataSource = mrList; comboBox.DataBind(); } else { } }
protected void cmbSearchCustomers_ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { if (e.Value != null && e.Value.ToString().Trim() != "") { // MemberResult selected = new MemberResult(); // ASPxComboBox comboBox = (ASPxComboBox)source; // List<MemberResult> mrList = new List<MemberResult>(); // mrList.Add(new MemberService().GetMemberResult(e.Value.ToString().Trim(), new SessionManager().GetUserId(this.Session))); // comboBox.DataSource = mrList; // comboBox.DataBind(); } else { } }
protected void ccbBarcode_ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { long value = 0; if (e.Value == null || !Int64.TryParse(e.Value.ToString(), out value)) { return; } ASPxComboBox comboBox = (ASPxComboBox)source; dsHangHoa.SelectCommand = @"SELECT hhHangHoa.IDHangHoa, hhHangHoa.MaHang, hhHangHoa.TenHangHoa, hhHangHoa.GiaBan,hhHangHoa.GiaVon FROM hhHangHoa WHERE (hhHangHoa.IDHangHoa = @IDHangHoa AND hhHangHoa.DaXoa = 0 AND hhHangHoa.LoaiHHID = 1)"; dsHangHoa.SelectParameters.Clear(); dsHangHoa.SelectParameters.Add("IDHangHoa", TypeCode.Int64, e.Value.ToString()); comboBox.DataSource = dsHangHoa; comboBox.DataBind(); }
protected void cmbHangHoa_ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { long value = 0; if (e.Value == null || !Int64.TryParse(e.Value.ToString(), out value)) { return; } ASPxComboBox comboBox = (ASPxComboBox)source; dsHangHoa.SelectCommand = @"SELECT CF_NguyenLieu.ID, CF_NguyenLieu.MaNguyenLieu, CF_NguyenLieu.TenNguyenLieu, CF_NguyenLieu.GiaMua, CF_DonViTinh.TenDonViTinh FROM CF_DonViTinh INNER JOIN CF_NguyenLieu ON CF_DonViTinh.ID = CF_NguyenLieu.IDDonViTinh WHERE (CF_NguyenLieu.ID = @ID)"; dsHangHoa.SelectParameters.Clear(); dsHangHoa.SelectParameters.Add("ID", TypeCode.Int64, e.Value.ToString()); comboBox.DataSource = dsHangHoa; comboBox.DataBind(); }
protected void cmbHangHoa_ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { long value = 0; if (e.Value == null || !Int64.TryParse(e.Value.ToString(), out value)) { return; } ASPxComboBox comboBox = (ASPxComboBox)source; sqlHangHoa.SelectCommand = @"SELECT GPM_HangHoa.ID, GPM_HangHoa.MaHang, GPM_HangHoa.TenHangHoa, GPM_DonViTinh.TenDonViTinh FROM GPM_DonViTinh INNER JOIN GPM_HangHoa ON GPM_DonViTinh.ID = GPM_HangHoa.IDDonViTinhSi WHERE (GPM_HangHoa.ID = @ID) ORDER BY TenHangHoa ASC "; sqlHangHoa.SelectParameters.Clear(); sqlHangHoa.SelectParameters.Add("ID", TypeCode.Int64, e.Value.ToString()); comboBox.DataSource = sqlHangHoa; comboBox.DataBind(); }
protected void cmbHangHoa_ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { long value = 0; if (e.Value == null || !Int64.TryParse(e.Value.ToString(), out value)) { return; } ASPxComboBox comboBox = (ASPxComboBox)source; dsHangHoa.SelectCommand = @"SELECT GPM_HangHoa.ID, GPM_HangHoa.MaHang, GPM_HangHoa.TenHangHoa, GPM_HangHoaTonKho.GiaBan, GPM_DonViTinh.TenDonViTinh FROM GPM_DonViTinh INNER JOIN GPM_HangHoa ON GPM_DonViTinh.ID = GPM_HangHoa.IDDonViTinh INNER JOIN GPM_HangHoaTonKho ON GPM_HangHoaTonKho.IDHangHoa = GPM_HangHoa.ID WHERE (GPM_HangHoa.ID = @ID) AND (GPM_HangHoa.IDTrangThaiHang = 1 OR GPM_HangHoa.IDTrangThaiHang = 3 ) AND GPM_HangHoaTonKho.IDKho = @IDKho"; dsHangHoa.SelectParameters.Clear(); dsHangHoa.SelectParameters.Add("ID", TypeCode.Int64, e.Value.ToString()); dsHangHoa.SelectParameters.Add("IDKho", TypeCode.Int32, Session["IDKho"].ToString()); comboBox.DataSource = dsHangHoa; comboBox.DataBind(); }
public void ItemRequestedByValue(object source, DevExpress.Web.ListEditItemRequestedByValueEventArgs e) { int value = 0; if (e.Value == null || !Int32.TryParse(e.Value.ToString(), out value)) { return; } ASPxComboBox comboBox = (ASPxComboBox)source; DataClassesDataContext dataContext = new DataClassesDataContext(); int id = Int32.Parse(e.Value.ToString()); var query = from category in dataContext.Categories where category.CategoryID == id select category; var count = query.Count(); comboBox.DataSource = query; comboBox.DataBind(); }