예제 #1
0
        public bool CompanyCustomerUpdate(int id, int cvr, string name, string address, int zip,
                                          string contactperson, string phoneno, string altphoneno, string email)
        {
            var rdg = new RDGs.RDGtblCompanyCustomers(this.session.ConnectionString);

            try
            {
                rdg.Update(new InterfaceAdaptor.CompanyCustomer()
                {
                    CompanyCustomersNo = id,
                    Active             = true,
                    Address            = address,
                    AltPhoneNo         = altphoneno,
                    ContactPerson      = contactperson,
                    CvrNo   = cvr,
                    Email   = email,
                    Name    = name,
                    PhoneNo = phoneno,
                    PostNo  = this.postNumbers.GetAtPostNumber(zip)
                });
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
예제 #2
0
        private void FildCompanyCustomers(bool?active)
        {
            this.companyCustomers.Clear();

            var rdg = new RDGs.RDGtblCompanyCustomers(this.session.ConnectionString);

            foreach (var item in rdg.Get(active))
            {
                this.companyCustomers.Add(item);
            }
        }
예제 #3
0
        public Interface.IcompanyCustomer FindCompanyCustomer(int id)
        {
            var rdg = new RDGs.RDGtblCompanyCustomers(this.session.ConnectionString);

            try
            {
                return(rdg.Find(id));
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #4
0
        public List <string> ListOfCompanyCustomers()
        {
            var list = new List <string>();

            var rdg = new RDGs.RDGtblCompanyCustomers(this.session.ConnectionString);

            foreach (var item in rdg.Get(true))
            {
                list.Add("#" + item.CompanyCustomersNo.ToString() + " - " + item.Name);
            }

            return(list);
        }
예제 #5
0
        public bool CompanyCustomerRemove(int id)
        {
            var rdg = new RDGs.RDGtblCompanyCustomers(this.session.ConnectionString);

            try
            {
                rdg.Delete(id);
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
예제 #6
0
        public DataTable GetInvoice()
        {
            var dataTable = new DataTable();

            dataTable.Columns.Add("Faktura nr", typeof(string));
            dataTable.Columns.Add("Kunde", typeof(string));
            dataTable.Columns.Add("Ordrenr 1", typeof(string));
            dataTable.Columns.Add("Ordrenr 2", typeof(string));
            dataTable.Columns.Add("Ordrenr 3", typeof(string));
            dataTable.Columns.Add("Ordrenr 4", typeof(string));
            dataTable.Columns.Add("Ordrenr 5", typeof(string));
            dataTable.Columns.Add("Ordrenr 6", typeof(string));
            dataTable.Columns.Add("Ordrenr 7", typeof(string));
            dataTable.Columns.Add("Ordrenr 8", typeof(string));
            dataTable.Columns.Add("Ordrenr 9", typeof(string));
            dataTable.Columns.Add("Ordrenr 10", typeof(string));
            dataTable.Columns.Add("Ordrenr 11", typeof(string));
            dataTable.Columns.Add("Ordrenr 12", typeof(string));
            dataTable.Columns.Add("Ordrenr 13", typeof(string));
            dataTable.Columns.Add("Ordrenr 14", typeof(string));
            dataTable.Columns.Add("Ordrenr 15", typeof(string));
            dataTable.Columns.Add("Ordrenr 16", typeof(string));
            dataTable.Columns.Add("Ordrenr 17", typeof(string));
            dataTable.Columns.Add("Ordrenr 18", typeof(string));
            dataTable.Columns.Add("Ordernr 19", typeof(string));
            dataTable.Columns.Add("Ordrenr 20", typeof(string));

            var rdgCustomersC  = new RDGs.RDGtblCompanyCustomers(this.session.ConnectionString);
            var invoiceCompany = new RDGs.RDGtblInvoiceCompany(this.session.ConnectionString).Get(true);

            foreach (var item in invoiceCompany)
            {
                var customers = rdgCustomersC.Find((int)item.Order[0]);

                dataTable.Rows.Add(
                    "C-" + item.Id,
                    "#" + customers.CompanyCustomersNo + ": " + customers.Name,
                    item.Order[0].ToString(),
                    item.Order[1].ToString(),
                    item.Order[2].ToString(),
                    item.Order[3].ToString(),
                    item.Order[4].ToString(),
                    item.Order[5].ToString(),
                    item.Order[6].ToString(),
                    item.Order[7].ToString(),
                    item.Order[8].ToString(),
                    item.Order[9].ToString(),
                    item.Order[10].ToString(),
                    item.Order[11].ToString(),
                    item.Order[12].ToString(),
                    item.Order[13].ToString(),
                    item.Order[14].ToString(),
                    item.Order[15].ToString(),
                    item.Order[16].ToString(),
                    item.Order[17].ToString(),
                    item.Order[18].ToString(),
                    item.Order[19].ToString());
            }

            var rdgCustomersP = new RDGs.RDGtblPrivateCustomers(this.session.ConnectionString);
            var invoicePrivet = new RDGs.RDGtblInvoicePrivet(this.session.ConnectionString).Get(true);

            foreach (var item in invoicePrivet)
            {
                var customers = rdgCustomersP.Find((int)item.Order[0]);

                dataTable.Rows.Add(
                    "P-" + item.Id,
                    "#" + customers.PrivateCustomersNo + ": " + customers.Name + " " + customers.Surname,
                    item.Order[0].ToString(),
                    item.Order[1].ToString(),
                    item.Order[2].ToString(),
                    item.Order[3].ToString(),
                    item.Order[4].ToString(),
                    item.Order[5].ToString(),
                    item.Order[6].ToString(),
                    item.Order[7].ToString(),
                    item.Order[8].ToString(),
                    item.Order[9].ToString(),
                    item.Order[10].ToString(),
                    item.Order[11].ToString(),
                    item.Order[12].ToString(),
                    item.Order[13].ToString(),
                    item.Order[14].ToString(),
                    item.Order[15].ToString(),
                    item.Order[16].ToString(),
                    item.Order[17].ToString(),
                    item.Order[18].ToString(),
                    item.Order[19].ToString());
            }

            return(dataTable);
        }