Exemple #1
0
        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);
        }
Exemple #2
0
        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]));
        }
Exemple #3
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);
        }