private void LoadDefaultValues() { //Load All Model Name SparePartsInfoBL viBL = new SparePartsInfoBL(); foreach (var SparePartsInfo in viBL.GetAllSparePartsInfo()) { ComboboxItem obj = new ComboboxItem(); obj.Text = SparePartsInfo.ModelName; obj.Value = SparePartsInfo.SparePartsInfoID; ddlModelName.Items.Add(obj); } //Load Inventory Status ddlInvStatus.Items.Clear(); SparePartsInventoryBL obj2 = new SparePartsInventoryBL(); foreach (var status in obj2.GetInventoryStatusType()) { ComboboxItem itemInventoryStatus = new ComboboxItem(); itemInventoryStatus.Text = status.Description; itemInventoryStatus.Value = status.SparePartsInventoryStatusTypeID; ddlInvStatus.Items.Add(itemInventoryStatus); } }
private void btnSearch_Click(object sender, EventArgs e) { var modelCode = txtModelCode.Text; var modelName = txtModelName.Text; SparePartsInfoBL obj = new SparePartsInfoBL(); var filterefInfo = obj.GetAllSparePartsInfo().Where(i => i.ModelCode.ToUpper().Contains(modelCode.ToUpper()) && i.ModelName.ToUpper().Contains(modelName.ToUpper())).ToList(); dgSparePartsInfo.DataSource = filterefInfo; }
private void LoadDefaultValues() { SparePartsInventoryBL obj = new SparePartsInventoryBL(); var lst = obj.GetAllSparePartsInventory(); if (_mode == "ADD") { lst = lst.Where(i => i.SparePartsInventoryStatusTypeID == 1).ToList(); } dgSparePartsInventory.DataSource = lst; //Get All Model Name ddlModelName.Items.Clear(); SparePartsInfoBL obj1 = new SparePartsInfoBL(); var allVehInfo = obj1.GetAllSparePartsInfo(); foreach (var vehInfo in allVehInfo) { //Load Model Name ComboboxItem itemModelName = new ComboboxItem(); itemModelName.Text = vehInfo.ModelName; itemModelName.Value = vehInfo.SparePartsInfoID; ddlModelName.Items.Add(itemModelName); } //Load Inventory Status ddlInventoryStatus.Items.Clear(); SparePartsInventoryBL obj2 = new SparePartsInventoryBL(); foreach (var status in obj2.GetInventoryStatusType()) { ComboboxItem itemInventoryStatus = new ComboboxItem(); itemInventoryStatus.Text = status.Description; itemInventoryStatus.Value = status.SparePartsInventoryStatusTypeID; ddlInventoryStatus.Items.Add(itemInventoryStatus); } }
private void LoadDefaultValues() { SparePartsInfoBL obj = new SparePartsInfoBL(); dgSparePartsInfo.DataSource = obj.GetAllSparePartsInfo(); }