Пример #1
0
        /// <summary>
        /// get the date of the first order in the DB in a dataTable and it is converted to string
        /// </summary>
        /// <returns>
        /// returns a string with the date of the oldest order in the DB
        /// </returns>
        public string firstOrderADL()
        {
            DataTable firstOrder = new OrderADL().firstOrderADL();
            DataRow   dataRow    = firstOrder.Rows[0];
            DateTime  date       = (DateTime)dataRow["firstOrder"];

            return(date.ToString("dd/MM/yyyy"));
        }
Пример #2
0
        /// <summary>
        /// The getProviderBLL method
        /// Get provider from the database.
        /// </summary>
        ///<return>
        /// Returns a datatable with the providers information.
        ///</return>
        private DataTable getProviderBLL()
        {
            DataTable providers = new DataTable();

            try
            {
                providers = new OrderADL().getProviderADL();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(providers);
        }
Пример #3
0
        /// <summary>
        /// The addOrder method
        /// Add an order in the database.
        /// </summary>
        ///<param name="orderID">
        /// This is the id of the order to add.
        ///</param>
        ///<param name="provider">
        /// This is the provider of the order to add.
        ///</param>
        ///<param name="partyName">
        /// This is the client name of the order to add.
        ///</param>
        ///<param name="date">
        /// This is the date of the order to add.
        ///</param>
        ///<param name="linkProduct">
        /// This is the linkq of the order to add.
        ///</param>
        ///<param name="description">
        /// This is the description of the order to add.
        ///</param>
        ///<param name="annotation">
        /// This is the annotation of the order to add.
        ///</param>
        ///<param name="costPrice">
        /// This is the cost of price of the order to add.
        ///</param>
        ///<param name="costSale">
        /// This is the cost of sale of the order to add.
        ///</param>
        public void addOrder(string orderID, String provider, String partyName, DateTime date, String linkProduct, String description, String annotation, double costPrice, double costSale, string status)
        {
            OrderADL orderADL  = new OrderADL();
            int      intStatus = 0;

            if (status.Equals(""))
            {
                intStatus = 1;
            }
            else
            {
                intStatus = convertStatusToInt(status);
            }

            orderADL.addOrderToDB(orderID, provider, intStatus, partyName, date, linkProduct, description, annotation, costPrice, costSale);
        }
Пример #4
0
        /// <summary>
        /// The checkOrderNumber method
        /// Check if a orderNumber is in the database .
        /// </summary>
        ///<param name="orderNumber">
        /// This is the orderNumber to check.
        ///</param>
        public bool checkOrderNumber(string orderNumber)
        {
            DataTable dt = new OrderADL().getOrdersFromDB();

            try
            {
                foreach (DataRow dr in dt.Rows)
                {
                    string name = dr["N. Orden"].ToString();
                    if (name.Equals(orderNumber))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
        }