Exemple #1
0
        private void button_findOrder_Click(object sender, EventArgs e)
        {
            panel_CustomerSalesInfo.Visible = true;
            orderID = Convert.ToInt32(numericUpDown_OrderID.Value);
            /*CLEAR LISTBOXES*/
            listBox_WorkTasks.Items.Clear();
            listBox_Employees.Items.Clear();
            listBox_Materials.Items.Clear();
            panel_MaterialInfo.Visible = false;
            panel_TasksInfo.Visible = false;
            checkBox_TaskIsComplete.Visible = false;
            currentOrder = cc.FindInquiry(orderID);
            /*CHECK IF ORDER EXISTS*/
            if (currentOrder != null)
            {
                /*LOAD CUSTOMER INFO*/
                textBox_CustomerName.Text = currentOrder.GetOffer().GetBuyer().GetFullName();
                textBox_CustomerAdress.Text = currentOrder.GetOffer().GetBuyer().GetAdresses()[0].GetAdress();
                textBox_CustomerCity.Text = cc.GetCityName(currentOrder.GetOffer().GetBuyer().GetAdresses()[0].GetPostalCode());
                textBox_CustomerPostalCode.Text = currentOrder.GetOffer().GetBuyer().GetAdresses()[0].GetPostalCode().ToString();
                textBox_CustomerPhone.Text = currentOrder.GetOffer().GetBuyer().getTlf()[0].ToString();
                textBox_CustomerId.Text = currentOrder.GetOffer().GetBuyer().GetID().ToString();
                /*LOAD SALESMAN INFO*/
                textBox_Salesman.Text = currentOrder.GetOffer().GetSalesMan().GetFullName();
                textBox_SalesmanPhone.Text = currentOrder.GetOffer().GetSalesMan().GetPhone().ToString();

                /*LOAD ORDER AND TASK INFO*/
                textBox_OrderValue.Text = currentOrder.getOrderValue().ToString();
                textBox_OrderCost.Text = currentOrder.getOrderCost().ToString();
                /*ONLY DO THIS, IF WORK TASKS EXIST!*/
                if (currentOrder.GetOffer().GetWorkTasks() != null)
                {
                    foreach (TaskDescription item in currentOrder.GetOffer().GetWorkTasks().GetTasks())
                    {
                        listBox_WorkTasks.Items.Add(item.GetDesc());
                    }
                }

            }
            else
            {
                /*LOAD CUSTOMER INFO*/
                textBox_CustomerName.Text = "";
                textBox_CustomerAdress.Text = "";
                textBox_CustomerCity.Text = "";
                textBox_CustomerPostalCode.Text = "";
                textBox_CustomerPhone.Text = "";
                textBox_CustomerId.Text = "";
                /*LOAD SALESMAN INFO*/
                textBox_Salesman.Text = "";
                textBox_SalesmanPhone.Text = "";

            }
        }
Exemple #2
0
        public void WriteOrderStatusXML(OrderDescription Order)
        {
            using (XmlWriter writer = XmlWriter.Create("OrderStatus.xml"))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement("Order");
                writer.WriteElementString("OrderID", Order.GetId().ToString());
                writer.WriteElementString("OfferID", Order.GetOffer().GetId().ToString());
                foreach (TaskDescription task in Order.GetOffer().GetWorkTasks().GetTasks())
                {
                    writer.WriteStartElement("Task");
                    writer.WriteElementString("TaskID", task.GetId().ToString());
                    writer.WriteElementString("Taskdescription", task.GetDesc());
                    writer.WriteElementString("Taskcomplete", task.GetStatus().ToString());
                    foreach (ItemLine item in task.GetItemLines())
                    {
                        writer.WriteStartElement("ItemLine");
                        writer.WriteElementString("itemID", item.GetItem().GetID().ToString());
                        writer.WriteElementString("itemLineID", item.GetLineID().ToString());
                        /*writer.WriteElementString("itemDesc", item.GetItem().GetDesc());*/

                        writer.WriteElementString("itemAmountExtra", item.GetAmountCompleted().ToString()); //TEMP FIX
                        writer.WriteElementString("itemAmount", item.GetAmount().ToString());
                        //writer.WriteElementString("itemIsCompleted", item.GetAmountCompleted().ToString());
                        writer.WriteElementString("itemIsComplete", item.GetStatus().ToString());
                        writer.WriteEndElement();
                    }
                    writer.WriteEndElement();
                }

                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }
Exemple #3
0
 public void UpdateOrder(OrderDescription CurrentOrder)
 {
     foreach (TaskDescription task in CurrentOrder.GetOffer().GetWorkTasks().GetTasks())
     {
         foreach (ItemLine taskentry in task.GetItemLines())
         {
             string update = "update TaskEntry set AmountExtra = " + taskentry.GetAmountCompleted() + " where TaskEntyID = " + taskentry.GetLineID();
             SQLQueryHelper(update);
         }
     }
 }