private void SearchCustNo(object ignored) { if (!string.IsNullOrEmpty(CustomerNoSearchCriteria.CustomerNo)) { IsBusy = true; ServiceAgent.SearchCustomer(CustomerNoSearchCriteria, (s, e) => { if (e.Error == null) { Customers = e.Result; if (Customers.Count > 0) { SelectedCustomer = Customers[0]; } else { Message = ApplicationResources.GetString(ConstantResources.LTNORESULTSFOUND); } } else { HandleError(e.Error); } IsBusy = false; }); } else { Message = ApplicationResources.GetString(ConstantResources.LTENTERCUSTOMERNO); } }
private void SortSearchResults() { if (SelectedSortItem != string.Empty) { if (SelectedSortItem == EnumReader.StringValueOf(CustomerSortParameters.CustomerNo)) { Customers = Customers.ToList().OrderBy(c => c.CustomerNo).ToObservableCollection(); } else if (SelectedSortItem == EnumReader.StringValueOf(CustomerSortParameters.CustomerName)) { Customers = Customers.ToList().OrderBy(c => c.CustomerName).ToObservableCollection(); } else if (SelectedSortItem == EnumReader.StringValueOf(CustomerSortParameters.SiteAddress)) { HandleError(new Exception(ApplicationResources.GetString(ConstantResources.LTSITESORTING))); } else if (SelectedSortItem == EnumReader.StringValueOf(CustomerSortParameters.PremiseAddress)) { HandleError(new Exception(ApplicationResources.GetString(ConstantResources.LTPREMISEADDRESSSORTING))); } if (Customers.Count > 0) { SelectedCustomer = Customers[0]; } } }
protected void gvSelectedResource_RowDeleting(object sender, GridViewDeleteEventArgs e) { int id = int.Parse((gvSelectedResouce.Rows[e.RowIndex].Cells[0].FindControl("hidId") as HiddenField).Value); ApplicationResources.RemoveItem(id); ucPager_onLoadPageIndexChaning(ucPager.PageIndex); }
public ComuniItalianiService( IOptions <ApplicationResources> appResources) { _appResources = appResources.Value ?? throw new ArgumentNullException(nameof(appResources)); GetJsonDataAsync().Wait(); GetCsvDataAsync().Wait(); }
private void LanguagesListBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (CurrentParameter.CurrentLanguage != null) { ApplicationResources applicationResources = Application.Current.Resources["ApplicationResources"] as ApplicationResources; if (applicationResources != null) { applicationResources.ChangeCulture(CurrentParameter.CurrentLanguage.Code); } } }
private void Search(object SearchCustNo) { if (!string.IsNullOrEmpty(CustomerSearchCriteria.ClientName) || !string.IsNullOrEmpty(CustomerSearchCriteria.Contact) || !string.IsNullOrEmpty(CustomerSearchCriteria.CustomerNo) || !string.IsNullOrEmpty(CustomerSearchCriteria.Phone) || !string.IsNullOrEmpty(CustomerSearchCriteria.PropertyName) || !string.IsNullOrEmpty(CustomerSearchCriteria.SalesCode) || !string.IsNullOrEmpty(CustomerSearchCriteria.StreetName) || !string.IsNullOrEmpty(CustomerSearchCriteria.StreetNo) || !string.IsNullOrEmpty(CustomerSearchCriteria.MeterNo) || !string.IsNullOrEmpty(CustomerSearchCriteria.Premise)) { IsBusy = true; ServiceAgent.SearchCustomer(CustomerSearchCriteria, (s, e) => { if (e.Error == null) { Customers = e.Result; FillSortDropdown(); if (Customers.Count > 0) { SelectedCustomer = Customers[0]; } else { Dialogs.Alert(ApplicationResources.GetString(ConstantResources.LTSEARCH), ApplicationResources.GetString(ConstantResources.LTNOCLIENTS), null); } } else { HandleError(e.Error); } IsBusy = false; }); } else { Dialogs.Alert(ApplicationResources.GetString(ConstantResources.LTSEARCHCRITERIA), ApplicationResources.GetString(ConstantResources.LTFILLSEARCHCRITERIA), null); } }
protected void btnAdd_Click(object sender, EventArgs e) { int riid = 0; int number = 0; try { number = Convert.ToInt32(txtNumber.Text.Trim()); ResourceInfo resource = ResourceInfoManager.Get(Convert.ToInt32(ddlResourceType.SelectedValue)); if (number > resource.Number) { this.ClientScript.RegisterStartupScript(GetType(), "", string.Format("<script>alert('库存数量为{0},您输入的数量以大于现有库存,请重新输入!')</script>", resource.Number)); return; } } catch { this.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请输入数字!')</script>"); return; } if (null != ddlResourceName.SelectedValue && "" != ddlResourceName.SelectedValue) { riid = Convert.ToInt32(ddlResourceName.SelectedValue); if (UrlReferrer == "/WebUI/ResourceManager/ApplyBorrow.aspx") { ApplicationResources.AddItem(ResourceInfoManager.Get(riid), 1, number); Response.Redirect("ApplyBorrow.aspx"); } else if (UrlReferrer == "/WebUI/ResourceManager/ApplyStock.aspx") { ApplicationResources.AddItem(ResourceInfoManager.Get(riid), 2, number); Response.Redirect("ApplyStock.aspx"); } } else { this.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('请选择资源!')</script>"); return; } }