Exemplo n.º 1
0
        public MapsForm(int id, object orders, object services)
        {
            InitializeComponent();


            //User label
            userid = id;
            setup(userid.ToString(), "FAFOS Day Itinerary");

            //Tables
            DataTable dt = new SalesOrder().getWorkOrders(userid);

            workOrderTable.DataSource = dt;

            DataTable dt2 = new ClientContract().getServices(userid.ToString());

            servicesTable.DataSource = dt2;

            order    = (WorkOrder[])orders;
            service  = (ContractService[])services;
            prefetch = true;


            //Load the map
            AsyncMapLoadCaller asyncMapLoad = new AsyncMapLoadCaller(LoadMap);

            asyncMapLoad.BeginInvoke(new AsyncCallback(MapLoaded), null);
            //LoadMap();
        }
Exemplo n.º 2
0
 public InvoiceController()
 {
     sales_order = new SalesOrder();
     order_items = new OrderItems();
     item        = new Item();
     SAddress    = new ServiceAddress();
     client      = new Client();
     contract    = new ClientContract();
     franchisee  = new Franchisee();
     inventory   = new Inventory();
 }
Exemplo n.º 3
0
        public void Notifications()
        {
            DataTable dt2 = new ClientContract().getServices(userid.ToString());

            serviceNotification.Text = "";

            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                if (Convert.ToDateTime(dt2.Rows[i][2]) == DateTime.Today)
                {
                    String service = dt2.Rows[i][0].ToString();
                    serviceNotification.Text += "\n" + service + " needs to be completed by today ";
                    serviceNotification.Text += "location - " + dt2.Rows[i][5].ToString() + "\n";
                }
            }
            if (serviceNotification.Text == "")
            {
                serviceNotification.Text = "";
            }



            DataTable dt = new Payment().getNotPaid(userid);

            paymentNotification.Text = "";
            for (int i = 2; i < dt.Rows.Count; i++)
            {
                if (Convert.ToDateTime(dt.Rows[i][2]) == DateTime.Today)
                {
                    String name = new Client().getName(new ClientContract().getClient(new SalesOrder().getSAddress(new Invoice().getSalesOrderID(dt.Rows[i][0].ToString()).ToString())));
                    paymentNotification.Text += "\n" + name + " has an outstanding balance of ";

                    DataTable payments = new Payment().getAmount(dt.Rows[i][0].ToString());
                    double    total    = 0;
                    for (int j = 0; j < payments.Rows.Count; j++)
                    {
                        total += Convert.ToDouble(payments.Rows[j][2]);
                    }
                    paymentNotification.Text += "$" + String.Format("{0:0.00}", Math.Round(Convert.ToDouble(dt.Rows[i][3].ToString()) - total, 2))
                                                + " on invoice #" + dt.Rows[i][0].ToString() + "\n";
                }
            }
            if (paymentNotification.Text == "")
            {
                paymentNotification.Text = "None";
            }
        }
Exemplo n.º 4
0
        public MapsForm(int id, object orders, object services)
        {
            InitializeComponent();

            //User label
            userid = id;
            setup(userid.ToString(), "FAFOS Day Itinerary");

            //Tables
            DataTable dt = new SalesOrder().getWorkOrders(userid);
            workOrderTable.DataSource = dt;

            DataTable dt2 = new ClientContract().getServices(userid.ToString());
            servicesTable.DataSource = dt2;

            order = (WorkOrder[])orders;
            service = (ContractService[])services;
            prefetch = true;

            //Load the map
            AsyncMapLoadCaller asyncMapLoad = new AsyncMapLoadCaller(LoadMap);
            asyncMapLoad.BeginInvoke(new AsyncCallback(MapLoaded), null);
            //LoadMap();
        }
Exemplo n.º 5
0
        public void Notifications()
        {
            DataTable dt2 = new ClientContract().getServices(userid.ToString());
            serviceNotification.Text = "";

            for (int i = 0; i < dt2.Rows.Count; i++)
            {

                if (Convert.ToDateTime(dt2.Rows[i][2]) == DateTime.Today)
                {
                    String service = dt2.Rows[i][0].ToString();
                    serviceNotification.Text += "\n" + service + " needs to be completed by today ";
                    serviceNotification.Text += "location - " + dt2.Rows[i][5].ToString() + "\n";
                }

            }
            if (serviceNotification.Text == "")
             serviceNotification.Text = "";

               DataTable dt = new Payment().getNotPaid(userid);
               paymentNotification.Text = "";
               for (int i = 2; i < dt.Rows.Count; i++)
               {
               if (Convert.ToDateTime(dt.Rows[i][2]) == DateTime.Today)
               {
                   String name = new Client().getName(new ClientContract().getClient(new SalesOrder().getSAddress(new Invoice().getSalesOrderID(dt.Rows[i][0].ToString()).ToString())));
                   paymentNotification.Text += "\n"+name+" has an outstanding balance of ";

                   DataTable payments = new Payment().getAmount(dt.Rows[i][0].ToString());
                   double total=0;
                   for (int j = 0; j < payments.Rows.Count; j++)
                   {
                       total += Convert.ToDouble(payments.Rows[j][2]);

                   }
                   paymentNotification.Text +=  "$" +String.Format("{0:0.00}",Math.Round(Convert.ToDouble(dt.Rows[i][3].ToString()) - total,2))
                       + " on invoice #" + dt.Rows[i][0].ToString()+"\n";
               }
               }
               if (paymentNotification.Text == "")
               paymentNotification.Text = "None";
        }