Exemplo n.º 1
0
        void wcDownloadPrepareHistory_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
        {
            MemoryStream ms     = new MemoryStream(e.Result);
            StreamReader reader = new StreamReader(ms);
            string       xml    = reader.ReadToEnd();

            //Trace.WriteLine(xml);
            reader.Close();
            ms.Close();

            int c = PrepareHistory.Load(xml);

            PromptForm prompt = e.UserState as PromptForm;

            prompt.Messages[prompt.Messages.Count - 1].Content = string.Format("成功下载{0}条出单记录.", c);
            prompt.RefreshDisplay();
            prompt.OKEnabled = true;
        }
Exemplo n.º 2
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            if (!IsOrderIdFormat(txtOrderId.Text.Trim()))
            {
                MessageBox.Show(this, "订单编号是15位或16位数字!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            PrepareHistory h = PrepareHistory.Get(txtOrderId.Text);

            if (null == h)
            {
                MessageBox.Show(this, "无出单记录", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(
                    this,
                    string.Format("已出单\n出单时间:{0}\n出单人:{1}\n店铺:{2}", h.Date.ToString("yyyy/MM/dd HH:mm:ss"), h.Operator, h.Shop),
                    this.Text,
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }