Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int insertNisLateOrder(NISLateOrders order)
        {
            object orderId = 0;

            try
            {
                System.Collections.Specialized.NameValueCollection args = new NameValueCollection();
                args.Add("@ID", order.ID.ToString());
                args.Add("@userID", order.UserId);
                args.Add("@email", order.Email);
                args.Add("@orderDate", order.OrderDate.ToString());
                args.Add("@dateReq", order.DateReq.ToString());
                args.Add("@PO", order.PO);
                args.Add("@sentDate", order.SentDate.ToString());
                args.Add("@items", order.Items.ToString());
                args.Add("@SON", order.SON);
                args.Add("@cutOff", order.CutOff.ToString());
                args.Add("@imported", order.Imported.ToString());
                DBContext.DBAccess access = new DBContext.DBAccess();
                //
                orderId = access.ExecuteScalar("MW_NISLateOrderInsert", DBContext.DBAccess.DBConnection.NameSys, args);
            }
            catch (Exception)
            {
            }
            return(Convert.ToInt32(orderId));
        }
Exemple #2
0
        /// <summary>
        ///     Get the next order number to be imported
        ///     Verify that the order was not imported before and has no sku problems.
        /// </summary>
        /// <returns>Next order number</returns>
        public int getNisOrdersToImport()
        {
            object orderId = 0;

            try
            {
                System.Collections.Specialized.NameValueCollection args = new NameValueCollection();
                DBContext.DBAccess access = new DBContext.DBAccess();
                //
                orderId = access.ExecuteScalar("MW_OrdersImport", DBContext.DBAccess.DBConnection.NameSys, args);
            }
            catch (Exception)
            {
            }
            return(Convert.ToInt32(orderId));
        }
Exemple #3
0
        /// <summary>
        ///     Update an specific order haeder information with the import results atatus codes.
        ///     The order parameter is mandatory
        ///     The option parameter update the WasImported columnn of the order header
        ///     The option importProblem update the hasImportProblem
        /// </summary>
        /// <param name="order">specified the order number to be updated</param>
        /// <param name="uOption">specified the import option - yes = 1 / no = 0</param>
        /// <param name="importProblem"></param>
        /// <returns></returns>
        public int updNisOrder(int order, int uOption, int importProblem, int NavOrder)
        {
            Object ret = 0;

            try
            {
                System.Collections.Specialized.NameValueCollection args = new NameValueCollection();
                args.Add("@Order", order.ToString());
                args.Add("@uOption", uOption.ToString());
                args.Add("@impProb", importProblem.ToString());
                args.Add("@NavOrder", "NAV-" + NavOrder.ToString());
                args.Add("@isNav", "1");        //  SET IS A NAV ORDER FLAG ON
                DBContext.DBAccess access = new DBContext.DBAccess();
                //
                ret = access.ExecuteScalar("MW_UpdNISOrder", DBContext.DBAccess.DBConnection.NameSys, args);
                //
            }
            catch (Exception)
            {
                wsl.writeSyncLog(1, Convert.ToInt16(ConfigurationManager.AppSettings["ServiceID"]), 1, ConfigurationManager.AppSettings["TableName"], "Table update error, order " + order);
            }
            return(Convert.ToInt32(ret));
        }