Ejemplo n.º 1
0
        /// <summary>
        /// 获取没有付款的本地订单
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public ArrayList getUnPayLocalOrder(string name)
        {
            ArrayList array = new ArrayList();

            string sql = "select * from tb_local_order where is_pay='unpay' and name='" + name + "'";

            DataTable table = new DBOperateCommon().excuteQuery(sql);

            for (int i = 0; i < table.Rows.Count; i++)
            {
                LocalOrder local_order = new LocalOrder();

                local_order.Id       = Convert.ToInt32(table.Rows[i]["order_id"].ToString());
                local_order.Order_no = table.Rows[i]["order_no"].ToString();
                local_order.Name     = table.Rows[i]["name"].ToString();

                local_order.Collectioncompanyname = table.Rows[i]["collectioncompanyname"].ToString();
                local_order.Collectioncontactname = table.Rows[i]["collectioncontactname"].ToString();
                local_order.Collectionphone       = table.Rows[i]["collectionphone"].ToString();
                local_order.Collectionaddressline = table.Rows[i]["collectionaddressline"].ToString();
                local_order.Collectiontown        = table.Rows[i]["collectiontown"].ToString();
                local_order.Collectionpostcode    = table.Rows[i]["collectionpostcode"].ToString();
                local_order.Collectioncountry     = table.Rows[i]["collectioncountry"].ToString();

                local_order.Recipientcompanyname = table.Rows[i]["recipientcompanyname"].ToString();
                local_order.Recipientcontactname = table.Rows[i]["recipientcontactname"].ToString();
                local_order.Recipientaddressline = table.Rows[i]["recipientaddressline"].ToString();
                local_order.Recipientphone       = table.Rows[i]["recipientphone"].ToString();
                local_order.Recipientpostcode    = table.Rows[i]["recipientpostcode"].ToString();
                local_order.Recipienttown        = table.Rows[i]["recipienttown"].ToString();
                local_order.Recipientcountry     = table.Rows[i]["recipientcountry"].ToString();

                local_order.Servicecode         = table.Rows[i]["servicecode"].ToString();
                local_order.Delivery_date       = table.Rows[i]["delivery_date"].ToString();
                local_order.Delivery_time       = table.Rows[i]["delivery_time"].ToString();
                local_order.Purpose             = table.Rows[i]["purpose"].ToString();
                local_order.Description         = table.Rows[i]["description"].ToString();
                local_order.Estimate_value      = Convert.ToSingle(table.Rows[i]["estimate_value"].ToString());
                local_order.Insurance           = Convert.ToSingle(table.Rows[i]["insurance"].ToString());
                local_order.Quantity            = Convert.ToInt32(table.Rows[i]["quantity"].ToString());
                local_order.Weight              = Convert.ToSingle(table.Rows[i]["weight"].ToString());
                local_order.Wm_track_no         = table.Rows[i]["wm_track_no"].ToString();
                local_order.Track_no            = table.Rows[i]["track_no"].ToString();
                local_order.Pay_before_discount = Convert.ToSingle(table.Rows[i]["pay_before_discount"].ToString());
                local_order.Discount            = Convert.ToSingle(table.Rows[i]["discount"].ToString());
                local_order.Pay_after_discount  = Convert.ToSingle(table.Rows[i]["pay_after_discount"].ToString());
                local_order.Less_pay            = Convert.ToSingle(table.Rows[i]["less_pay"].ToString());
                local_order.Wm_pay              = Convert.ToSingle(table.Rows[i]["wm_pay"].ToString());
                local_order.Profit              = Convert.ToSingle(table.Rows[i]["profit"].ToString());
                local_order.Pay_way             = table.Rows[i]["pay_way"].ToString();
                local_order.Is_pay              = table.Rows[i]["is_pay"].ToString();
                local_order.Pay_time            = table.Rows[i]["pay_time"].ToString();
                local_order.Order_time          = table.Rows[i]["order_time"].ToString();

                array.Add(local_order);
            }


            return(array);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加本地订单
        /// </summary>
        /// <param name="local_order"></param>
        /// <returns></returns>
        public bool addLocalOrder(LocalOrder local_order)
        {
            bool flag = false;

            string sql = "insert into tb_local_order values('" + local_order.Order_no + "','" + local_order.Name + "','" + local_order.Collectioncompanyname + "','" + local_order.Collectioncontactname + "','" + local_order.Collectionphone + "','" + local_order.Collectionaddressline + "','" +
                         local_order.Collectiontown + "','" + local_order.Collectionpostcode + "','" + local_order.Collectioncountry + "','" + local_order.Recipientcompanyname + "','" + local_order.Recipientcontactname + "','" + local_order.Recipientphone + "','" + local_order.Recipientaddressline + "','" +
                         local_order.Recipienttown + "','" + local_order.Recipientpostcode + "','" + local_order.Recipientcountry + "','" + local_order.Servicecode + "','" + local_order.Delivery_date + "','" + local_order.Delivery_time + "','" + local_order.Purpose + "','" + local_order.Description + "'," +
                         local_order.Estimate_value + "," + local_order.Insurance + "," + local_order.Quantity + "," + local_order.Weight + ",'" + local_order.Wm_track_no + "','" + local_order.Track_no + "'," + local_order.Pay_before_discount + "," + local_order.Discount + "," + local_order.Pay_after_discount + "," + local_order.Less_pay + "," +
                         local_order.Wm_pay + "," + local_order.Profit + ",'" + local_order.Pay_way + "','" + local_order.Is_pay + "','" + local_order.Pay_time + "','" + local_order.Order_time + "')";

            if (new DBOperateCommon().excuteNoQuery(sql))
            {
                flag = true;
            }

            return(flag);
        }