protected void ClearEntry() { // clear process data MRPScriptManager.SetFocus("ProcessDropDown"); MstrConfigCodeTextBox.Text = ""; MstrConfigNameTextBox.Text = ""; IncUnPlatedCheckBox.Checked = false; ProcessUpdatePanel.Update(); ProcessUpdatePanel.Visible = false; Session["Process"] = null; // set buttons AddButt.Visible = true; CommandUpdatePanel.Update(); // clear tree ProcessTreeView.Visible = false; // clear filters FilterUpdatePanel.Visible = false; Session["LinkedFilters"] = null; LinkedFilters = null; FilterGrid.DataBind(); // clear steps StepUpdatePanel.Visible = false; StepGrid.DataBind(); Session["LinkedSteps"] = null; LinkedSteps = null; }
//Open client form for edit private void Edit_Click(object sender, RoutedEventArgs e) { //Hide filter if (FilterGrid.Opacity != 0) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } //Get button control Button Control = (Button)sender; var Client = NovaAPI.APIClient.clients.Find(x => x.id == Control.Tag.ToString()); if (FormGrid.Opacity == 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("PopUpGrid")); } //Set supplier information to controls ClientNameTX.Text = Client.name; ClientIDTX.Text = Client.documentid; ClientTypeCB.SelectedIndex = Convert.ToInt32(Client.type); ClientPhoneTX.Text = Client.phone; ClientCelphoneTX.Text = Client.celphone; ClientAddressTX.Text = Client.address; ClientMailTX.Text = Client.mail; ClientCreditCB.IsChecked = Client.cancredit == "0" ? false : true; //Set selected supplier id index for edition save SelectedIndex = Control.Tag.ToString(); //Focus editable rol ClientNameTX.Focus(); SaveBT.IsEnabled = true; }
private async void NewSupplierBT_Click(object sender, RoutedEventArgs e) { if (FilterGrid.Opacity != 0) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); await Task.Delay(100); } //From grid animation if (FormGrid.Opacity == 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("PopUpGrid")); SuppSocialNameTX.Focus(); SaveBT.IsEnabled = true; } else if (SuppSocialNameTX.Text.Length == 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); ResetForm(); } //Clear supplier values if (SuppSocialNameTX.Text.Length > 0) { ResetForm(); } }
public async void closeClearSearchViewafterSearch(object sender, EventArgs e) { try { JobListHelper.IsSearching = false; JobListHelper.IntialzieList(); clear.IsEnabled = false; search.IsEnabled = false; await((JobSearchviewModel)CurrentJobsLayout.BindingContext).BindData(true, true); // ChangeToCurrent(null, null); } catch (Exception ex) { var logged = new LoggedException.LoggedException("Error in joblistingtapedimage.xaml.cs", ex); await logged.LoggAPI(); } finally { await FilterGrid.FadeTo(0); FilterGrid.IsVisible = false; searchtap.BackgroundColor = Color.White; isearchtap.Source = "Magnifier.png"; searchtapLabel.TextColor = Color.DimGray; MyJobstap.BackgroundColor = Color.FromHex("#87c8ee"); iMyJobstap.Source = "MyJobsi.png"; MyJobstapLabel.TextColor = Color.White; search.IsEnabled = true; clear.IsEnabled = true; } }
// returns block with specified name casted to specified type T; // returns null if not found // example: // var assembler = utils.FindBlock<IMyProductionBlock>("Assembler 42"); public T FindBlockIfExists <T>(string name, FilterGrid filter = FilterGrid.None) where T : class { try { return(FindBlock <T>(name, filter)); } catch (Exception e) { return(null); } }
private bool checkFilterGrid(FilterGrid filter, IMyTerminalBlock block) { if (filter == FilterGrid.Current) { if (thisProgrammableBlock == null || thisProgrammableBlock.CubeGrid != block.CubeGrid) { return(false); } } return(true); }
private async void TapGestureRecognizer_Tapped_1(object sender, EventArgs e) { try { if (_userTapped1) { return; } _userTapped1 = true; selectgridtabs.IsEnabled = false; if (FilterGrid.IsVisible) { constants.SearchView = false; await FilterGrid.FadeTo(0); FilterGrid.IsVisible = false; searchtap.BackgroundColor = Color.White; isearchtap.Source = "Magnifier.png"; searchtapLabel.TextColor = Color.DimGray; // MyJobstap.BackgroundColor = Color.FromHex("#87c8ee"); iMyJobstap.Source = "MyJobsi.png"; MyJobstapLabel.TextColor = Color.White; namegrid.IsVisible = true; CurrentJobsLayout.IsVisible = true; //gray color } else { FilterGrid.IsVisible = true; await FilterGrid.FadeTo(1); searchtap.BackgroundColor = Color.FromHex("#87c8ee"); isearchtap.Source = "Magnifieri.png"; searchtapLabel.TextColor = Color.White; MyJobstap.BackgroundColor = Color.White; iMyJobstap.Source = "MyJobs.png"; MyJobstapLabel.TextColor = Color.DimGray; //blue color } } catch (Exception ex) { var logged = new LoggedException.LoggedException("Error while trying to load jobs", ex); await logged.LoggAPI(); } finally { _userTapped1 = false; selectgridtabs.IsEnabled = true; } }
public async void closeSearchViewafterSearch(object sender, EventArgs e) { try { if (startDate.Date >= endDate.Date) { await DisplayAlert(AlertMessages.ErrorTitle, AlertMessages.comparedate, "Ok"); return; } else { JobListHelper.IsSearching = true; search.IsEnabled = false; clear.IsEnabled = false; await((JobSearchviewModel)CurrentJobsLayout.BindingContext).BindData(true); MyJobstap.BackgroundColor = Color.FromHex("#87c8ee"); iMyJobstap.Source = "MyJobsi.png"; MyJobstapLabel.TextColor = Color.White; searchtap.BackgroundColor = Color.White; isearchtap.Source = "Magnifier.png"; searchtapLabel.TextColor = Color.DimGray; await FilterGrid.FadeTo(0); search.IsEnabled = true; clear.IsEnabled = true; FilterGrid.IsVisible = false; constants.SearchView = false; namegrid.IsVisible = true; CurrentJobsLayout.IsVisible = true; ChangeToCurrent(null, null); } } catch (Exception ex) { var logged = new LoggedException.LoggedException("Error in joblistingtapedimage.xaml.cs", ex); logged.LoggAPI(); } //finally //{ // await FilterGrid.FadeTo(0); // search.IsEnabled = true; // clear.IsEnabled = true; // FilterGrid.IsVisible = false; // constants.SearchView = false; // namegrid.IsVisible = true; // CurrentJobsLayout.IsVisible = true; // DisplayAlert(AlertMessages.ErrorTitle, "!!!!!!!!!!!1", "Ok"); //} }
//Edit product button toggle private void Edit_Click(object sender, RoutedEventArgs e) { //Get button control Button Control = (Button)sender; if (FilterGrid.Opacity != 0) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } var ProductData = NovaAPI.APIProdructs.products.Find(x => x.id == Control.Tag.ToString()); if (FormGrid.Opacity == 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("PopUpGrid")); } //Set popup name PopUpProductName.Content = ProductData.name; PopUpProductValue.Content = string.Format("Precio venta general: {0:C0}", Convert.ToInt32(ProductData.sellprice)); //Set product information to controls ProductCodeTX.Text = ProductData.code; ProductNameTX.Text = ProductData.name; ProductCatCB.SelectedItem = NovaAPI.APICategory.category.Find(x => x.id == ProductData.category); ProductCostTX.Number = Convert.ToInt32(ProductData.costprice); ProductPriceTX.Number = Convert.ToInt32(ProductData.sellprice); ProductTypeCB.SelectedIndex = Convert.ToInt32(ProductData.unity_type); MinStockTX.Text = ProductData.minstock; MaxStockTX.Text = ProductData.maxstock; //Set taxes if (ProductData.iva == "0" && ProductData.iac == "0" && ProductData.iva5 == "0") { TaxNoneRB.IsChecked = true; } else { TaxIvaRB.IsChecked = ProductData.iva == "1" ? true : false; TaxIva5RB.IsChecked = ProductData.iva5 == "1" ? true : false; TaxIacRB.IsChecked = ProductData.iac == "1" ? true : false; } //Set selected product id index for edition save ProductSelectIndex = Control.Tag.ToString(); //Focus editable product ProductCodeTX.Focus(); SaveProductBT.IsEnabled = true; PricesBT.IsEnabled = true; }
// returns single inventory of the block with specified name public IMyInventory FindInventory(string name, FilterGrid filter = FilterGrid.None) { var block = FindBlock <IMyTerminalBlock>(name, filter); var inventory = block.GetInventory(); if (inventory != null) { return(inventory); } else { throw new Exception(string.Format("no inventory in block \"{0}\"", name)); } }
public void SortFilterGrid(Object sender, GridViewSortEventArgs e) { try { // Create a DataView from the Linked Category filters. DataView dv = new DataView((DataTable)Session["LinkedFilters"]); dv.Sort = e.SortExpression; FilterGrid.DataSource = dv; FilterGrid.DataBind(); //FilterGridPanel.Height = new Unit(double.Parse(FilterGridHeightHidden.Value), UnitType.Pixel); //FilterGridPanel.Width = new Unit(double.Parse(FilterGridWidthHidden.Value), UnitType.Pixel); } catch (Exception e2) { ShowPageMessage("Filter Sort Error " + e2.Message + ", " + e2.ToString(), 2); } }
private void ShowFilters() { // show linked filters FilterUpdatePanel.Visible = true; LinkedFilters = CheckError(mrpCalc.MstrConfigDataGetFilters(CurProcess.Value)); if ((LinkedFilters != null) && (LinkedFilters.Rows.Count > 0)) { Session["LinkedFilters"] = LinkedFilters; FilterGrid.DataSource = LinkedFilters; FilterGrid.DataBind(); } else { Session["LinkedFilters"] = null; FilterGrid.DataBind(); ShowPageMessage("No Category Filter are linked. Used the Add button to create a new link", 0, FilterMessage, FilterUpdatePanel); } }
//Refresh products data private void RefreshProducts_Click(object sender, RoutedEventArgs e) { if (FormGrid.Opacity == 1) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } if (FilterGrid.Opacity == 1) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } TotalPages = 0; Pagination = 1; ResetForm(); LoadProducts(); NewProductBT.Focus(); }
private async void FilterBT_Click(object sender, RoutedEventArgs e) { if (FormGrid.Opacity != 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); ResetForm(); await Task.Delay(100); } FilterTX.Clear(); if (FilterGrid.Opacity == 0) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("PopUpGrid")); FilterTX.Focus(); } else { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } }
//Clear all form data and selections private void ClearFormData() { if (FormGrid.Opacity != 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } if (FilterGrid.Opacity != 0) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } FilterTX.Clear(); ClientNameTX.Clear(); ClientIDTX.Clear(); ClientPhoneTX.Clear(); ClientAddressTX.Clear(); ClientMailTX.Clear(); ClientCelphoneTX.Clear(); ClientTypeCB.SelectedIndex = 0; ClientCreditCB.IsChecked = true; SaveBT.IsEnabled = false; }
// returns all inventories in blocks with specified filter public List <IMyInventory> Inventories(FilterGrid filter = FilterGrid.None) { var result = new List <IMyInventory>(); foreach (var block in blocks) { if (!checkFilterGrid(filter, block)) { continue; } for (int i = 0; i < block.InventoryCount; i++) { var inventory = block.GetInventory(i); if (inventory != null) { result.Add(inventory); } } } return(result); }
private void Edit_Click(object sender, RoutedEventArgs e) { //Hide filter if (FilterGrid.Opacity != 0) { FilterGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("FadeInGrid")); } //Get button control Button Control = (Button)sender; var Supplier = NovaAPI.APISupplier.suppliers.Find(x => x.id == Control.Tag.ToString()); if (FormGrid.Opacity == 0) { FormGrid.BeginStoryboard((Storyboard)Application.Current.TryFindResource("PopUpGrid")); } //Set supplier information to controls SuppSocialNameTX.Text = Supplier.socialname; SuppComercialNameTX.Text = Supplier.comercialname; SuppidTypeCB.SelectedIndex = Convert.ToInt32(Supplier.idtype); SuppIDTX.Text = Supplier.documentid; SuppAddressTX.Text = Supplier.address; SuppPhoneTX.Text = Supplier.phone; SuppCelphoneTX.Text = Supplier.celphone; SuppEmailTX.Text = Supplier.mail; SuppContactTX.Text = Supplier.contact; SuppObvsTX.Text = Supplier.observation; StatusCB.IsChecked = Supplier.status == "1" ? true : false; //Set selected supplier id index for edition save SelectedIndex = Control.Tag.ToString(); //Focus editable rol SuppSocialNameTX.Focus(); SaveBT.IsEnabled = true; }
// returns block with specified name casted to specified type T; // throws Exception if not found // example: // var assembler = utils.FindBlock<IMyProductionBlock>("Assembler 42"); public T FindBlock <T>(string name, FilterGrid filter = FilterGrid.None) where T : class { foreach (var block in blocks) { if (!checkFilterGrid(filter, block)) { continue; } if (block.CustomName == name) { var result = block as T; if (result == null) { throw new Exception("failed to cast block \"{0}\""); } else { return(result); } } } throw new Exception(string.Format("failed to find block \"{0}\"", name)); }
protected override async void OnAppearing() { try { // await LoadJobs(); //JobListHelper.ExpireTimerEnabled = false; await Task.Yield(); LoadingIndicatorHelper.Intialize(this); if (JobListHelper.IsApplied) { //Refresh Applied List int oldCount = JobsCounterHelper.NoOfAppliedJobs; await((AppliedJobsViewModel)AppliedJobsLayout.BindingContext).BindData(true); int newCount = oldCount + 1; JobsCounterHelper.NoOfAppliedJobs = newCount; JobsCounterHelper._noOfAppliedJobsText = JobsCounterHelper.NoOfAppliedJobsText(); ((JobSearchviewModel)namegrid.BindingContext).Applied = JobsCounterHelper.NoOfAppliedJobsText(); ChangeToApplied(null, null); JobListHelper.IsSearching = false; JobListHelper.IsSaved = false; } //else if (JobListHelper.IsSearching) //{ // JobListHelper.IsApplied = false; // JobLissearchtaptHelper.IsSaved = false; // .BackgroundColor = Color.FromHex("#87c8ee"); // isearchtap.Source = "Magnifier.png"; // searchtapLabel.TextColor = Color.White; // MyJobstap.BackgroundColor = Color.White; // iMyJobstap.Source = "MyJobsi.png"; // MyJobstapLabel.TextColor = Color.DimGray; // ChangeToCurrent(null, null); //} else if (JobListHelper.IsSaved) { JobListHelper.IsSearching = false; JobListHelper.IsSaved = false; ChangeToSaved(null, null); } if (constants.SearchView) { constants.SearchView = false; //if (FilterGrid.IsVisible) //{ // FilterGrid.FadeTo(0); // FilterGrid.IsVisible = false; // searchtap.BackgroundColor = Color.White; // isearchtap.Source = "Magnifier.png"; // searchtapLabel.TextColor = Color.DimGray; // //gray color //} //else //{ FilterGrid.IsVisible = true; CurrentJobsLayout.IsVisible = false; namegrid.IsVisible = false; FilterGrid.FadeTo(1); searchtap.BackgroundColor = Color.FromHex("#87c8ee"); isearchtap.Source = "Magnifieri.png"; searchtapLabel.TextColor = Color.White; MyJobstap.BackgroundColor = Color.White; iMyJobstap.Source = "MyJobs.png"; MyJobstapLabel.TextColor = Color.DimGray; //} } else { MyJobstap.BackgroundColor = Color.FromHex("#87c8ee"); iMyJobstap.Source = "MyJobsi.png"; MyJobstapLabel.TextColor = Color.White; CurrentJobsLayout.IsVisible = true; } } catch (Exception ex) { var logged = new LoggedException.LoggedException("error in joblisting.xaml.cs", ex); await logged.LoggAPI(); } }