private void refreshList() { TEMPOServerProxy tsp = TEMPO.RequestBroker.TEMPOServerProxy.Instance; ClientDS ds = tsp.GetAllClients(); ctv.refreshTree(ds); }
public Argix.Enterprise.Clients GetClients() { //Get a list of clients Argix.Enterprise.Clients clients = null; try { clients = new Argix.Enterprise.Clients(); DataSet ds = fillDataset(USP_CLIENTS, TBL_CLIENTS, new object[] { }); if (ds.Tables[TBL_CLIENTS].Rows.Count > 0) { ClientDS __clients = new ClientDS(); __clients.Merge(ds); ClientDS _clients = new ClientDS(); _clients.Merge(__clients.InvoiceClientTable.Select("DivisionNumber='01'", "ClientName ASC")); for (int i = 0; i < _clients.InvoiceClientTable.Rows.Count; i++) { if (InvoicingConfig.Document.DocumentElement.SelectSingleNode("//client[@number='" + _clients.InvoiceClientTable[i].ClientNumber + "']") != null) { Argix.Enterprise.Client client = new Argix.Enterprise.Client(_clients.InvoiceClientTable[i]); clients.Add(client); } } } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating client list.", ex); } return(clients); }
public ClientCRUDPanel() : base(new Point(20, 140), new Size(820, 430), "ClientCRUD", false) { // background this.setGraphic(new Bitmap(typeof(TEMPO.Client.MainScreen), "Resources.CRUDpanel.png")); // build the tree view // obtain the data from the server TEMPOServerProxy tsp = TEMPO.RequestBroker.TEMPOServerProxy.Instance; ClientDS ds = tsp.GetAllClients(); // populate the control ctv = new CRUDTreeViewDS("Employees", ds, "ClientName"); ctv.onCRUDItemClicked += new CRUDTreeViewDS.CRUDItemClickedDelegate(openEntity); ctv.Location = new Point(32, 71); ctv.Size = new Size(306, 222); this.Controls.Add(ctv); entrypanel = new ClientCRUDEntryPanel(ClientCRUDEntryPanel.EntryType.Save); entrypanel.Visible = false; entrypanel.onRecordMaintained += new ClientCRUDEntryPanel.RecordMaintainDelegate(refreshList); this.Controls.Add(entrypanel); createpanel = new ClientCRUDEntryPanel(ClientCRUDEntryPanel.EntryType.Create); createpanel.Visible = false; createpanel.onRecordMaintained += new ClientCRUDEntryPanel.RecordMaintainDelegate(refreshList); this.Controls.Add(createpanel); create = new GraphicButton(new Point(180, 315), new Size(155, 28)); create.setGraphic(new Bitmap(typeof(TEMPO.Client.MainScreen), "Resources.addnewdocument.png")); create.Click += new System.EventHandler(newRecord); this.Controls.Add(create); }
/// <summary> /// Update a Client /// </summary> /// <param name="ds"></param> public void Update(ClientDS ds) { string sql; SqlConnection conn = new SqlConnection(this.DBConnectionString); sql = "insert into Client (ClientName) values (@ClientName)"; SqlCommand insertCommand = new SqlCommand(sql, conn); insertCommand.Parameters.Add("@ClientName", System.Data.SqlDbType.VarChar, 255, "ClientName"); insertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord; sql = "update Client set ClientName = @ClientName Where ClientID = @ClientID"; SqlCommand updateCommand = new SqlCommand(sql, conn); updateCommand.Parameters.Add("@ClientName", System.Data.SqlDbType.VarChar, 255, "ClientName"); updateCommand.Parameters.Add("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"); sql = "delete from Client Where ClientID = @ClientID"; SqlCommand deleteCommand = new SqlCommand(sql, conn); deleteCommand.Parameters.Add("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"); try { SqlHelper.UpdateDataset(insertCommand, deleteCommand, updateCommand, ds, "Client"); } catch { throw new Exception(); } }
public override global::System.Data.DataSet Clone() { ClientDS cln = ((ClientDS)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { ClientDS ds = new ClientDS(); 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 public ClientDS GetClients() { //Get a list of clients ClientDS clients = null; try { clients = new ClientDS(); clients.ClientTable.AddClientTableRow("012", "01", "L'OCCITANE", "05", "A"); clients.ClientTable.AddClientTableRow("014", "01", "MELVITA", "05", "A"); clients.ClientTable.AddClientTableRow("025", "01", "PRATT RETAIL SPECIALTIES", "05", "A"); clients.ClientTable.AcceptChanges(); } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating client list.", ex); } return(clients); }
public static Client GetClient(string clientNumber) { //Create a client ClientDS client = null; try { client = new ClientDS(); DataSet ds = App.Mediator.FillDataset(USP_CLIENT_DETAIL, TBL_CLIENT_DETAIL, new object[] { clientNumber }); if (ds.Tables[TBL_CLIENT_DETAIL].Rows.Count == 0) { throw new Exception("Client number " + clientNumber + " not found."); } else { client.Merge(ds); } } catch (Exception ex) { throw ex; } return(new Client(client.ClientDetailTable[0])); }
public static Client CreateClientForStoreSAN(string division, string sanNumber) { //Create a client based on Store san Client client = null; try { DataSet ds = Mediator.FillDataset(USP_CLIENT_DETAIL_SAN, TBL_CLIENT_DETAIL, new object[] { division, sanNumber }); if (ds.Tables[TBL_CLIENT_DETAIL].Rows.Count == 0) { throw new ApplicationException("Client for san number " + sanNumber + " not found."); } else { ClientDS clientDS = new ClientDS(); clientDS.Merge(ds); client = new Client(clientDS.ClientDetailTable[0]); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating client.", ex); } return(client); }
/// <summary> /// Get all the Clients /// </summary> /// <returns>a strongly typed data set</returns> public ClientDS GetAllClients() { string sql; sql = "select * from Client;"; ClientDS ds = new ClientDS(); string[] tables = new string[] { "Client" }; SqlParameter[] sqlparams = new SqlParameter[2]; SqlParameter temp = new SqlParameter("@ClientID", SqlDbType.Int, 4, "ClientID"); temp.Direction = System.Data.ParameterDirection.Output; sqlparams[0] = temp; temp = new SqlParameter("@ClientName", SqlDbType.VarChar, 4, "ClientName"); temp.Direction = System.Data.ParameterDirection.Output; sqlparams[1] = temp; SqlHelper.FillDataset(this.DBConnectionString, System.Data.CommandType.Text, sql, ds, tables, sqlparams); return(ds); }
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(); ClientDS ds = new ClientDS(); 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 = "ClientTableDataTable"; 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); }
/// <summary> /// Initializes a new instance of the <see cref="ClientXSD"/> class. /// </summary> /// <remarks> /// Class Constructor /// </remarks> public ClientXSD() { this.clientdS = new ClientDS(); }
public DataSet ToDataSet() { //Return a dataset containing values for this object ClientDS ds = null; try { ds = new ClientDS(); ClientDS.ClientDetailTableRow client = ds.ClientDetailTable.NewClientDetailTableRow(); if (this._clientid > 0) { client.ClientID = this._clientid; } if (this._clientnumber.Length > 0) { client.ClientNumber = this._clientnumber; } if (this._clientnumber.Length > 0) { client.NUMBER = this._number; } if (this._clientnumber.Length > 0) { client.DIVISION = this._division; } if (this._name.Length > 0) { client.NAME = this._name; } if (this._status.Length > 0) { client.STATUS = this._status; } if (this._ups_shipper_nbr.Length > 0) { client.UPS_SHIPPER_NBR = this._ups_shipper_nbr; } if (this._abbreviation.Length > 0) { client.ABBREVIATION = this._abbreviation; } if (this._address_line1.Length > 0) { client.ADDRESS_LINE1 = this._address_line1; } if (this._address_line2.Length > 0) { client.ADDRESS_LINE2 = this._address_line2; } if (this._city.Length > 0) { client.CITY = this._city; } if (this._state.Length > 0) { client.STATE = this._state; } if (this._zip.Length > 0) { client.ZIP = this._zip; } if (this._zip4.Length > 0) { client.ZIP4 = this._zip4; } if (this._delivery_bill_type.Length > 0) { client.DELIVERY_BILL_TYPE = this._delivery_bill_type; } if (this._carton_commodity.Length > 0) { client.CARTON_COMMODITY = this._carton_commodity; } if (this._delivery_bill.Length > 0) { client.DELIVERY_BILL_TYPE = this._delivery_bill; } if (this._dbill_copies > 0) { client.DBILL_COPIES = this._dbill_copies; } if (this._issan.Length > 0) { client.IsSan = this._issan; } if (this._invoiceprogram.Length > 0) { client.InvoiceProgram = this._invoiceprogram; } if (this._contactname.Length > 0) { client.ContactName = this._contactname; } if (this._phone.Length > 0) { client.Phone = this._phone; } if (this._fax.Length > 0) { client.Fax = this._fax; } if (this._mnemonic.Length > 0) { client.Mnemonic = this._mnemonic; } if (this._blnumberoninvoice.Length > 0) { client.BLNumberOnInvoice = this._blnumberoninvoice; } if (this._arnumber.Length > 0) { client.ARNumber = this._arnumber; } if (this._pickupzip.Length > 0) { client.PickupZip = this._pickupzip; } if (this._manifestpertrailer.Length > 0) { client.ManifestPerTrailer = this._manifestpertrailer; } client.LastUpdated = this._lastupdated; client.UserID = this._userid; ds.ClientDetailTable.AddClientDetailTableRow(client); ds.AcceptChanges(); } catch (Exception) { } return(ds); }
public void UpdateClients(ClientDS ds) { ClientDALC cdalc = new ClientDALC(); cdalc.Update(ds); }