Ejemplo n.º 1
0
        private void writeOrderDetails(ref XmlWriter xmlWrite, string strOrder)
        {
            clsDatabase      objDB   = new clsDatabase(HiTecResources.DB);
            string           strSQL  = "Select sum(Qty)as Qty From OrderDetails Where OrderDetails.Orders_Number ='" + strOrder + "'";
            SQLiteDataReader objData = objDB.returnData(strSQL);
            string           strQty  = objData["Qty"].ToString();

            strSQL = "SELECT PartID, Description, Qty";
            strSQL = strSQL + " FROM OrderDetails";
            strSQL = strSQL + " WHERE Orders_Number ='" + strOrder + "'";

            objData = objDB.returnData(strSQL);
            xmlWrite.WriteStartElement("OrderDetails");
            xmlWrite.WriteAttributeString("TotalQty", strQty);

            while (objData.Read())
            {
                xmlWrite.WriteStartElement("Item");
                xmlWrite.WriteElementString("Number", objData["PartID"].ToString());
                xmlWrite.WriteElementString("Description", objData["Description"].ToString());
                xmlWrite.WriteElementString("Qty", objData["Qty"].ToString());
                xmlWrite.WriteEndElement();
            }

            xmlWrite.WriteEndElement();
        }
Ejemplo n.º 2
0
        private void LoadGrid(string strType)
        {
            this.Cursor = Cursors.WaitCursor;
            // Todo - move this string, probably should be put in an xml initialization file

            clsDatabase      objDatabase = new clsDatabase(HiTecResources.DB);
            SQLiteDataReader objData     = objDatabase.returnData(strType);
            int Row = 0;

            grdOrders.ColumnCount = objData.FieldCount;
            //for resizing columns
            Graphics objGraphics = this.CreateGraphics();

            int[] colW = new int[objData.FieldCount];

            grdOrders.Rows.Clear();

            //adding data to grid
            while (objData.Read())
            {
                grdOrders.Rows.Add();

                for (int Col = 0; Col < objData.FieldCount; Col++)
                {
                    if (Row == 0)
                    {
                        string strHeader = objData.GetName(Col);
                        grdOrders.Columns[Col].HeaderText = objData.GetName(Col);
                    }

                    SizeF objSize = objGraphics.MeasureString(objData[Col].ToString(), grdOrders.Font);
                    if (objSize.Width > colW[Col])
                    {
                        colW[Col] = (int)objSize.Width + 5;
                    }
                    grdOrders[Col, Row].Value = objData[Col].ToString();
                }
                Row++;
            }

            //Resizing rows
            AdjustGrid(colW, grdOrders.Columns.Count);

            if (strType == "UnShipped" && mnuRightClick.Items.Count == 1)
            {
                mnuRightClick.Items.Add("Void Order");
            }
            else if (strType == "Shipped" && mnuRightClick.Items.Count == 2)
            {
                mnuRightClick.Items.Remove(mnuRightClick.Items[1]);
            }

            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 3
0
        private void writeShippedInfo(ref XmlWriter xmlWrite, string strOrder)
        {
            clsDatabase      objDB   = new clsDatabase(HiTecResources.DB);
            SQLiteDataReader objData = objDB.returnData("Select * From Tracking where Orders_Number ='" + strOrder + "'");

            xmlWrite.WriteStartElement("SentInfo");
            xmlWrite.WriteElementString("Tracking", objData["Tracking"].ToString());
            xmlWrite.WriteElementString("Carrier", objData["ShipMethod"].ToString());
            DateTime TS = Convert.ToDateTime(objData["TS"]);

            xmlWrite.WriteElementString("ShippedDate", TS.ToString("MM/dd/yyyy hh:mm"));     //DateTime.Today.ToString("M/dd/yyyy")
            xmlWrite.WriteElementString("Weight", objData["Weight"].ToString());
            xmlWrite.WriteElementString("ShipCost", objData["Cost"].ToString());
            xmlWrite.WriteEndElement();
        }
Ejemplo n.º 4
0
        private void writeBillTo(ref XmlWriter xmlWrite, string strOrder)
        {
            clsDatabase      objDB   = new clsDatabase(HiTecResources.DB);
            SQLiteDataReader objData = objDB.returnData("Select * From BillTo where Orders_Number ='" + strOrder + "'");

            xmlWrite.WriteStartElement("BillTo");
            xmlWrite.WriteElementString("Contact", objData["Contact"].ToString());
            xmlWrite.WriteElementString("Address1", objData["Address1"].ToString());
            xmlWrite.WriteElementString("Address2", objData["Address2"].ToString());
            xmlWrite.WriteElementString("Address3", objData["Address3"].ToString());
            string strCityStateZip = objData["City"].ToString() + ", " + objData["State"].ToString() + " " + objData["Zip"].ToString();

            xmlWrite.WriteElementString("CityStateZip", strCityStateZip);
            xmlWrite.WriteElementString("Country", objData["Country"].ToString());
            xmlWrite.WriteEndElement();
        }
Ejemplo n.º 5
0
        private void writeOrders(ref XmlWriter xmlWrite, string strOrder)
        {
            clsDatabase      objDB   = new clsDatabase(HiTecResources.DB);
            SQLiteDataReader objData = objDB.returnData("Select * From Orders where Number ='" + strOrder + "'");

            xmlWrite.WriteStartElement("Order");
            xmlWrite.WriteElementString("LastOrder", "True");

            xmlWrite.WriteStartElement("ShippingInfo");
            xmlWrite.WriteElementString("Number", objData["Number"].ToString());
            xmlWrite.WriteElementString("Carrier", objData["ShipMethod"].ToString());
            xmlWrite.WriteElementString("Email", objData["Email"].ToString());
            xmlWrite.WriteElementString("Phone", objData["Telephone"].ToString());
            xmlWrite.WriteElementString("ShippingAccount", objData["ShippingAccount"].ToString());
            xmlWrite.WriteElementString("AES", objData["AES"].ToString());
        }