protected void txtTransporter_TextChanged(object sender, EventArgs e) { OnSelectingTransporter(this, new SelectingTransporterEventArgs() { TransporterName = txtTransporter.Text }); ProfileManager profileManager; if (txtTransporter.Text.Contains('|')) { profileManager = new ProfileManager(this); transporterManager = new TransporterManager(this); string[] identifications = txtTransporter.Text.Split('|'); string identification = identifications[0].ToString().Trim(); LegalEntityProfile legalEntityProfile = profileManager.GetLegalEntityProfile(identification); if (legalEntityProfile != null) { transporter = transporterManager.GetTransporterByLegalEntityProfile(Page.Company.CompanyId, legalEntityProfile.LegalEntityProfileId); } ShowTransporter(transporter); } }
protected void Page_Load(object sender, EventArgs e) { manager = new TransporterManager(this); if (!IsPostBack) { // //retrieve the transporterId from modalPopup // if (Request["TransporterId"] != null) Context.Items["TransporterId"] = Request["TransporterId"]; if (Context.Items["TransporterId"] != null) Page.ViewState["TransporterId"] = Context.Items["TransporterId"]; if (Page.ViewState["TransporterId"] != null) { originalTransporter = manager.GetTransporter(Convert.ToInt32(Page.ViewState["TransporterId"])); if (originalTransporter != null) Profile_LegalEntity1.CompanyProfileEntity = originalTransporter.LegalEntityProfile; } else if (Page.ViewState["LegalEntityProfileId"] != null) { originalTransporter = manager.GetTransporterByProfile(Convert.ToInt32(Page.ViewState["LegalEntityProfileId"])); if (originalTransporter != null) { Page.ViewState["ProfileExists"] = "0"; Profile_LegalEntity1.CompanyProfileEntity = originalTransporter.LegalEntityProfile; } } } }
public ClientResponse FindTransporter(string q, int limit) { return(new ClientResponse(() => { using (var transporterManager = new TransporterManager(null)) return transporterManager.SearchTransporter((int)Company.MatrixId, q, limit).ToArray(); })); }
public static bool DeleteTransporter(int transporterid) { bool result = true; using (TransporterManager transporterManager = new TransporterManager(null)) { try { transporterManager.Delete(transporterManager.GetTransporter(transporterid)); } catch (System.Data.SqlClient.SqlException e) { result = false; } } return(result); }
protected void txtTransporter_TextChanged(object sender, EventArgs e) { OnSelectingTransporter(this, new SelectingTransporterEventArgs() { TransporterName = txtTransporter.Text }); ProfileManager profileManager; if (txtTransporter.Text.Contains('|')) { profileManager = new ProfileManager(this); transporterManager = new TransporterManager(this); string[] identifications = txtTransporter.Text.Split('|'); string identification = identifications[0].ToString().Trim(); LegalEntityProfile legalEntityProfile = profileManager.GetLegalEntityProfile(identification); if (legalEntityProfile != null) transporter = transporterManager.GetTransporterByLegalEntityProfile(Page.Company.CompanyId, legalEntityProfile.LegalEntityProfileId); ShowTransporter(transporter); } }
protected void Page_Load(object sender, EventArgs e) { manager = new TransporterManager(this); if (!IsPostBack) { // //retrieve the transporterId from modalPopup // if (Request["TransporterId"] != null) { Context.Items["TransporterId"] = Request["TransporterId"]; } if (Context.Items["TransporterId"] != null) { Page.ViewState["TransporterId"] = Context.Items["TransporterId"]; } if (Page.ViewState["TransporterId"] != null) { originalTransporter = manager.GetTransporter(Convert.ToInt32(Page.ViewState["TransporterId"])); if (originalTransporter != null) { Profile_LegalEntity1.CompanyProfileEntity = originalTransporter.LegalEntityProfile; } } else if (Page.ViewState["LegalEntityProfileId"] != null) { originalTransporter = manager.GetTransporterByProfile(Convert.ToInt32(Page.ViewState["LegalEntityProfileId"])); if (originalTransporter != null) { Page.ViewState["ProfileExists"] = "0"; Profile_LegalEntity1.CompanyProfileEntity = originalTransporter.LegalEntityProfile; } } } }
public ClientResponse FindTransporter(string q, int limit) { return new ClientResponse(() => { using (var transporterManager = new TransporterManager(null)) return transporterManager.SearchTransporter((int)Company.MatrixId, q, limit).ToArray(); }); }
public static bool DeleteTransporter(int transporterid) { bool result = true; using (TransporterManager transporterManager = new TransporterManager(null)) { try { transporterManager.Delete(transporterManager.GetTransporter(transporterid)); } catch (System.Data.SqlClient.SqlException e) { result = false; } } return result; }