public void BindPartsDetail() { if (ForecastingPart.PartNumber.Trim() == string.Empty) { ForecastingPart.CategoryCode = string.Empty; ForecastingPart.PartType = string.Empty; } else { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = ForecastingPart.PartNumber, filter1 = string.Empty, filter4 = Constants.RetriveForm, FilterKey = Constants.TableMaterials }; var parts = _controlPanel.GetMaterials(queryArgument); var firstOrDefault = parts.FirstOrDefault(); if (firstOrDefault == null) { return; } ForecastingPart.CategoryCode = firstOrDefault.MaterialType.Id; ForecastingPart.PartType = firstOrDefault.MaterialGroup.Id; } uplView.Update(); }
private void AlternativePartCahnge() { if (string.IsNullOrEmpty(ForecastingEditPart.AltPartNumber.ToTrimString())) { ForecastingEditPart.CategoryCode = string.Empty; ForecastingEditPart.PartType = string.Empty; } else { //BindPartsDetail(true); var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = ForecastingEditPart.AltPartNumber, filter1 = string.Empty, filter4 = Constants.RetriveForm, FilterKey = Constants.TableMaterials }; var parts = _controlPanel.GetMaterials(queryArgument); var firstOrDefault = parts.FirstOrDefault(); if (firstOrDefault == null) { return; } ForecastingEditPart.AltPartCat = firstOrDefault.MaterialType.Id; ForecastingEditPart.AltPartType = firstOrDefault.MaterialGroup.Id; } uplView.Update(); }
public void BindData(BindType bindType) { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = bindType == BindType.List ? PartSearch : Code, filter1 = string.Empty, filter2 = PartType, filter3 = PartGroup, filter4 = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm, FilterKey = Constants.TableMaterials }; var parts = _controlPanel.GetMaterials(queryArgument); if (bindType == BindType.List) { // Datatable = parts; BindData(parts); // BindData(); } else { var firstOrDefault = parts.FirstOrDefault(); if (firstOrDefault == null) { return; } Description = firstOrDefault.Description; DetailedDescription = firstOrDefault.DetailedDescription; Unit = firstOrDefault.Unit; SalesPrice = firstOrDefault.SalesPrice; CreatedDate = firstOrDefault.Created; PartType = firstOrDefault.MaterialType.Id; fillPartGroupDdl(); PartGroup = firstOrDefault.MaterialGroup.Id; PriceValideDate = firstOrDefault.PriceValidDate; uplForm.Update(); } }