Exemple #1
0
        /// <summary>
        /// 根据条件获取单个符合条件的订单,会员信息。传入CustomerDelivery页面-退款
        /// </summary>
        /// <param name="searchString"></param>
        /// <param name="customerDelivery"></param>
        public void GetReturnOrderInfo(string searchString, CustomerDelivery customerDelivery)
        {
            MysqlDBHelper dbHelper = new MysqlDBHelper();
            //string sql = "select a.id, a.consignee, a.cansignphone, b.associator_cardnumber, a.ORDERAMOUNT  from zc_order_transit a left join zc_associator_info b on a.member_id = b.id where a.orderstatus = '" + Constant.ORDER_STATUS_FININSH + "' ";

            string sql = "select a.id, a.consignee, a.cansignphone, b.associator_cardnumber, a.ORDERAMOUNT  from zc_order_history a left join zc_associator_info b on a.member_id = b.id where a.orderstatus in ('" + Constant.ORDER_STATUS_FININSH + "','" + Constant.ORDER_STATUS_PART_REFUSE + "') ";

            if (searchString != "")
            {
                ///根据条件查询
                sql += " and ( a.consignee like '%" + searchString + "%' or a.cansignphone like '%" + searchString + "%' or b.associator_cardnumber like '%" + searchString + "%' ) ";
            }
            MySqlConnection conn = null;
            MySqlCommand    cmd  = new MySqlCommand();

            try
            {
                conn            = dbHelper.GetConnection();
                cmd.Connection  = conn;
                cmd.CommandText = sql;
                MySqlDataReader reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    string id     = reader.IsDBNull(0) ? string.Empty : reader.GetString(0);
                    string name   = reader.IsDBNull(1) ? string.Empty : reader.GetString(1);
                    string phone  = reader.IsDBNull(2) ? string.Empty : reader.GetString(2);
                    string card   = reader.IsDBNull(3) ? string.Empty : reader.GetString(3);
                    string amount = reader.IsDBNull(4) ? string.Empty : reader.GetString(3);
                    customerDelivery.setinform(id, amount, name, phone, card);
                }
            }
            catch (Exception ex)
            {
                log.Error("获取订单信息发送异常", ex);
            }
            finally
            {
                cmd.Dispose();
                dbHelper.CloseConnection(conn);
            }
        }
Exemple #2
0
        /// <summary>
        /// 将选中的单据内的数据传入页面
        /// </summary>
        private void chooseDocket()
        {
            customerDelivery.initNumberAndAmount();

            string order_Num = listDataGridView.CurrentRow.Cells[0].Value.ToString();
            string name      = listDataGridView.CurrentRow.Cells[2].Value.ToString();
            string phone     = listDataGridView.CurrentRow.Cells[3].Value.ToString();
            string card      = listDataGridView.CurrentRow.Cells[4].Value.ToString();
            /////当前工作模式为提货状态
            //if (WorkMode == Constant.PICK_UP_GOODS)
            //{
            string order_Amount = listDataGridView.CurrentRow.Cells[1].Value.ToString();

            customerDelivery.setOrderNum(order_Num);
            customerDelivery.setinform(order_Num, order_Amount, name, phone, card);
            //}
            /////当前工作模式为退款状态
            //if (WorkMode == Constant.REFUND)
            //{
            //    string actual_moneycard = listDataGridView.CurrentRow.Cells[5].Value.ToString();
            //    customerDelivery.setOrderNum(order_Num);
            //    customerDelivery.setinform(order_Num, actual_moneycard, name, phone, card);
            //}
        }