private void LoadRequest(RequestWithNotify item) { TextBoxResolutionPartNo.Text = item.ResolutionPartNo; TextBoxPartNo.Text = item.PartNo; TextBoxPartNoOriginal.Text = item.ResolutionPartNo; DatePickerRequestDate.SelectedValue = item.RequestDate; NumericUpDownQty.Value = item.Qty; DatePickerEntranceDate.SelectedValue = item.EntranceDate; TextBoxDescription.Text = item.Description; ComboBoxRequestStatus.SelectedIndex = (int)item.RequestStatus; }
private void RibbonButtonRemoveFromExport_OnClick(object sender, RoutedEventArgs e) { if (View.CurrentItem == null) { return; } var requests = GridViewRequests.SelectedItems; foreach (var request in requests) { RequestWithNotify requestWithNotify = (RequestWithNotify)request; requestWithNotify.Export = false; } }
private void RibbonButtonAddToExport_OnClick(object sender, RoutedEventArgs e) { if (View.CurrentItem == null) { return; } var requests = GridViewRequests.SelectedItems; foreach (var request in requests) { RequestWithNotify requestWithNotify = (RequestWithNotify)request; int index = RequestsCollection.IndexOf(requestWithNotify); requestWithNotify.Export = true; } }
private void ButtonAdd_OnClick(object sender, RoutedEventArgs e) { ClearStatusbar(); if (TextBoxResolutionPartNo.Text.Length == 0 && TextBoxPartNo.Text.Length == 0 && TextBoxPartNoOriginal.Text.Length == 0) { ShowMessageInStatusbar("you should provide at least one part no"); return; } if (DatePickerRequestDate.SelectedValue == null) { ShowMessageInStatusbar("Request date can not be empty"); return; } if (NumericUpDownQty.Value == null) { ShowMessageInStatusbar("Qty can not be empty"); return; } RequestWithNotify requestWithNotify = new RequestWithNotify(); requestWithNotify.ResolutionPartNo = TextBoxResolutionPartNo.Text; requestWithNotify.PartNo = TextBoxPartNo.Text; requestWithNotify.PartNoOriginal = TextBoxPartNoOriginal.Text; requestWithNotify.RequestDate = (DateTime)DatePickerRequestDate.SelectedValue; requestWithNotify.Qty = (int)NumericUpDownQty.Value; requestWithNotify.EntranceDate = DatePickerEntranceDate.SelectedValue; requestWithNotify.Description = TextBoxDescription.Text; requestWithNotify.RequestStatus = (RequestStatus)ComboBoxRequestStatus.SelectedIndex; var result = RequestsCollection.AddNew(0, requestWithNotify); if (result) { ShowMessageInStatusbar("new requestd added"); } else { ShowMessageInStatusbar("Failed"); } }
private void MenuItemCompleted_OnClick(object sender, RadRoutedEventArgs e) { if (View.CurrentItem == null) { return; } var requests = GridViewRequests.SelectedItems; foreach (var request in requests) { RequestWithNotify requestWithNotify = (RequestWithNotify)request; Request currentRequest = Entities.Requests.FirstOrDefault(x => x.RequestId == requestWithNotify.RequestId); if (currentRequest != null) { currentRequest.RequestStatus = (int)RequestStatus.Completed; } } Entities.SaveChanges(); BindGridViewRequests(); }