コード例 #1
0
        /// <summary>
        /// Creates a new instance of the Qds_PaymentMethod class and populates it with data from the specified SqlDataReader.
        /// </summary>
        protected virtual Qds_PaymentMethod MakeQds_PaymentMethod(SqlDataReader dataReader)
        {
            Qds_PaymentMethod qds_PaymentMethod = new Qds_PaymentMethod();

            qds_PaymentMethod.PaymentMethodID = SqlClientUtility.GetInt32(dataReader, "PaymentMethodID", 0);
            qds_PaymentMethod.PaymentMethod   = SqlClientUtility.GetString(dataReader, "PaymentMethod", String.Empty);

            return(qds_PaymentMethod);
        }
コード例 #2
0
        /// <summary>
        /// Saves a record to the Qds_PaymentMethod table.
        /// </summary>
        public virtual void Insert(Qds_PaymentMethod qds_PaymentMethod)
        {
            ValidationUtility.ValidateArgument("qds_PaymentMethod", qds_PaymentMethod);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@PaymentMethod", qds_PaymentMethod.PaymentMethod)
            };

            qds_PaymentMethod.PaymentMethodID = (int)SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "Qds_PaymentMethod_Insert", parameters);
        }
コード例 #3
0
        /// <summary>
        /// Updates a record in the Qds_PaymentMethod table.
        /// </summary>
        public virtual void Update(Qds_PaymentMethod qds_PaymentMethod)
        {
            ValidationUtility.ValidateArgument("qds_PaymentMethod", qds_PaymentMethod);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@PaymentMethodID", qds_PaymentMethod.PaymentMethodID),
                new SqlParameter("@PaymentMethod", qds_PaymentMethod.PaymentMethod)
            };

            SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "Qds_PaymentMethod_Update", parameters);
        }
コード例 #4
0
        /// <summary>
        /// Selects all records from the Qds_PaymentMethod table.
        /// </summary>
        public virtual List <Qds_PaymentMethod> SelectAll()
        {
            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "Qds_PaymentMethod_SelectAll"))
            {
                List <Qds_PaymentMethod> qds_PaymentMethodList = new List <Qds_PaymentMethod>();
                while (dataReader.Read())
                {
                    Qds_PaymentMethod qds_PaymentMethod = MakeQds_PaymentMethod(dataReader);
                    qds_PaymentMethodList.Add(qds_PaymentMethod);
                }

                return(qds_PaymentMethodList);
            }
        }
コード例 #5
0
        private void ReadDrops(bool MineOnly)
        {
            listViewDrops.Items.Clear();

            string orderType = String.Empty;

            if (checkBoxMissingBags.Checked)
            {
                orderType = "M";
            }
            else
            {
                orderType = "Q";
            }

            //qds_DropList = qds_Drop_Sp.SelectAllInProcess();
            qds_DropList = qds_Drop_Sp.SelectAllByOrderTpe(orderType);
            if (qds_DropList != null)
            {
                if (buttonBags.Text == "&Unselect all")
                {
                    buttonBags.Text = "&Select all";
                }
            }


            Guid UserId = new Guid();

            if (MineOnly)
            {
                if (sol_Order_Sp == null)
                {
                    sol_Order_Sp = new Sol_Order_Sp(Properties.Settings.Default.WsirDbConnectionString);
                }

                MembershipUser UserAccount = Membership.GetUser();
                UserId = (Guid)UserAccount.ProviderUserKey;
            }

            //dropID
            //customer
            //bags
            //paymentMethod
            //depotID
            //orderID

            foreach (Qds_Drop or in qds_DropList)
            {
                if (MineOnly)
                {
                    //is not user's order if does not exist
                    if (or.OrderID < 1)
                    {
                        continue;
                    }

                    sol_Order = sol_Order_Sp.Select(or.OrderID, or.OrderType);
                    //is not user's order if does not exist
                    if (sol_Order == null)
                    {
                        continue;
                    }

                    if (UserId != null)
                    {
                        if (UserId != sol_Order.UserID)
                        {
                            continue;
                        }
                    }
                }

                int    dropID   = or.DropID;
                string customer = or.CustomerID.ToString();
                sol_Customer = sol_Customer_Sp.Select(or.CustomerID);
                if (sol_Customer != null)
                {
                    customer = sol_Customer.Name;
                }

                int bags = or.NumberOfBags;

                string paymentMethod = or.PaymentMethodID.ToString();
                qds_PaymentMethod = qds_PaymentMethod_Sp.Select(or.PaymentMethodID);
                if (qds_PaymentMethod != null)
                {
                    paymentMethod = qds_PaymentMethod.PaymentMethod;
                }

                string depotID = or.DepotID;
                int    orderID = or.OrderID;

                addDropItem(dropID, customer, bags, paymentMethod, depotID, orderID, or.OrderType);
            }
        }