private string getStoreDetailString(StoreDS storeDS) { //Return a string of store detail StringBuilder detail = new StringBuilder(); if (storeDS.StoreTable.Rows.Count > 0) { StoreDS.StoreTableRow store = storeDS.StoreTable[0]; detail.AppendLine(store.StoreName.Trim() + " (store #" + store.StoreNumber.ToString() + "; substore #" + store.SubStoreNumber.Trim() + ")"); detail.AppendLine((!store.IsStoreAddressline1Null() ? store.StoreAddressline1.Trim() : "")); detail.AppendLine((!store.IsStoreAddressline2Null() ? store.StoreAddressline2.Trim() : "")); detail.AppendLine((!store.IsStoreCityNull() ? store.StoreCity.Trim() : "") + ", " + (!store.IsStoreStateNull() ? store.StoreState.Trim() : "") + " " + (!store.IsStoreZipNull() ? store.StoreZip.Trim() : "")); detail.AppendLine((!store.IsContactNameNull() ? store.ContactName.Trim() : "") + ", " + (!store.IsPhoneNumberNull() ? store.PhoneNumber.Trim() : "")); detail.AppendLine((!store.IsRegionDescriptionNull() ? store.RegionDescription.Trim() : "") + " (" + (!store.IsRegionNull() ? store.Region.Trim() : "") + "), " + (!store.IsDistrictNameNull() ? store.DistrictName.Trim() : "") + " (" + (!store.IsDistrictNull() ? store.District.Trim() : "") + ")"); detail.AppendLine("Zone " + (!store.IsZoneNull() ? store.Zone.Trim() : "") + ", " + "Agent " + (!store.IsAgentNumberNull() ? store.AgentNumber.Trim() : "") + " " + (!store.IsAgentNameNull() ? store.AgentName.Trim() : "")); detail.AppendLine("Window " + (!store.IsWindowTimeStartNull() ? store.WindowTimeStart.ToString("HH:mm") : "") + " - " + (!store.IsWindowTimeEndNull() ? store.WindowTimeEnd.ToString("HH:mm") : "") + ", " + "Del Days " + getDeliveryDays(store) + ", " + (!store.IsScanStatusDescrptionNull() ? store.ScanStatusDescrption.Trim() : "")); detail.AppendLine("JA Transit " + (!store.IsStandardTransitNull() ? store.StandardTransit.ToString() : "") + ", " + "OFD " + getOFD(store)); detail.AppendLine("Special Inst: " + (!store.IsSpecialInstructionsNull() ? store.SpecialInstructions.Trim() : "")); } return(detail.ToString()); }
protected async Task HandleValidSubmit() { Saved = false; if (Store.Id == null) //new { var success = await StoreDS.AddStore(Store); if (success) { StatusClass = "alert-success"; Message = "New Store added successfully."; Saved = true; } else { StatusClass = "alert-danger"; Message = "Something went wrong adding the new Store. Please try again."; Saved = false; } } else { //await EmployeeDataService.UpdateEmployee(Employee); //StatusClass = "alert-success"; //Message = "Employee updated successfully."; //Saved = true; } }
private void OnCompanyLocationChanged(object sender, EventArgs e) { //Event handler for change in location (i.e. cboLocation.SelectionChangeCommitted, txtStore.TextChanged) //Raise a CompanyLocationChanged event with the change in location try { string location = null; string scope = this.cboScope.SelectedItem.ToString(); switch (scope) { case SCOPE_DISTRICTS: case SCOPE_REGIONS: case SCOPE_AGENTS: if (this.cboLocation.SelectedValue != null) { location = this.cboLocation.SelectedValue.ToString() == "All" ? "" : this.cboLocation.SelectedValue.ToString(); } break; case SCOPE_STORES: case SCOPE_SUBSTORES: this.mStoreDS = new StoreDS(); this.txtStoreDetail.Clear(); break; } if (this.CompanyLocationChanged != null) { this.CompanyLocationChanged(this, EventArgs.Empty); } } catch (Exception ex) { reportError(new ControlException("Unexpected error when company location changed.", ex)); } }
private void showStoreDetail() { // this.txtStoreDetail.Text = ""; if (this.cboCompany.SelectedValue.Length > 0 && this.txtStore.Text.Length > 0) { StoreDS ds = new StoreDS(); CompanyDS companies = new IssueMgtServiceClient().GetCompanies(); CompanyDS.CompanyTableRow[] rows = (CompanyDS.CompanyTableRow[])companies.CompanyTable.Select("Number='" + this.cboCompany.SelectedValue + "'"); if (rows.Length > 0) { int companyID = rows[0].CompanyID; switch (this.cboScope.SelectedItem.ToString()) { case SCOPE_STORES: ds.Merge(new IssueMgtServiceClient().GetStoreDetail(companyID, Convert.ToInt32(this.txtStore.Text))); break; case SCOPE_SUBSTORES: ds.Merge(new IssueMgtServiceClient().GetSubStoreDetail(companyID, this.txtStore.Text)); break; } if (ds.StoreTable.Rows.Count > 0) { this.txtStoreDetail.Text = getStoreDetailString(ds); } } } }
public override global::System.Data.DataSet Clone() { StoreDS cln = ((StoreDS)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { StoreDS ds = new StoreDS(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
//Interface /// <summary>Creates a new instance of the Argix.Customers.CompanyLocation control.</summary> public CompanyLocation() { //Constructor try { InitializeComponent(); this.mStoreDS = new StoreDS(); this.mStoreDetail = new ToolTip(); this.mStoreDetail.IsBalloon = false; this.mStoreDetail.InitialDelay = 50; this.mStoreDetail.ShowAlways = true; } catch (Exception ex) { throw new ControlException("Unexpected error while creating new CompanyLocation control instance.", ex); } }
public static StoreDS GetStoreDetail(int companyID, string subStore) { //Get a list of store locations StoreDS stores = null; try { _Client = new IssueMgtServiceClient(); stores = _Client.GetSubStoreDetail(companyID, subStore); _Client.Close(); } catch (FaultException fe) { throw new ApplicationException("GetStoreDetail() service error.", fe); } catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetStoreDetail() timeout error.", te); } catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetStoreDetail() communication error.", ce); } return(stores); }
protected override async Task OnInitializedAsync() { Saved = false; if (string.IsNullOrEmpty(StoreId))//new Store is being created { //add some defaults Store = new Store { DateCreated = DateTime.UtcNow }; } else { Store = await StoreDS.GetStoreById(StoreId); } }
private void showStoreDetail() { // this.mStoreDS = new StoreDS(); this.txtStoreDetail.Clear(); if (this.cboCompany.SelectedValue != null && this.txtStore.Text.Length > 0) { StoreDS ds = new StoreDS(); switch (this.cboScope.SelectedItem.ToString()) { case SCOPE_STORES: ds.Merge(CustomerProxy.GetStoreDetail(Convert.ToInt32(CompanySelectedValue), Convert.ToInt32(this.txtStore.Text))); break; case SCOPE_SUBSTORES: ds.Merge(CustomerProxy.GetStoreDetail(Convert.ToInt32(CompanySelectedValue), this.txtStore.Text)); break; } if (ds.StoreTable.Rows.Count > 0) { this.mStoreDS = ds; this.txtStoreDetail.Text = getStoreDetailString(); } } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); StoreDS ds = new StoreDS(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "StoreTableDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }