Ejemplo n.º 1
0
        private void SetShelfStatus(ShelfStatus status)
        {
            txtItemStatus.Text = status.ItemStatus.DispName;

            txtShelfSb.Text = String.Format("(商:{0})", status.ShohinBan);
            txtShelfJy.Text = String.Format("状態:{0}", status.Jyotai);
            txtShelfAr.Text = String.Format("粗:{0}", status.Arari);

            txtShelfJMise.Text = status.Mise;

            txtShelfJZaiko.Text    = String.Format("{0}", status.JZaiko);
            txtShelfJZaiHatsu.Text = String.Format("{0}", status.JZaiHatsu);
            txtShelfJIso.Text      = String.Format("{0}", status.JIso);
            txtShelfJHatten.Text   = String.Format("{0}", status.JHatten);
            txtShelfJSyubai1.Text  = String.Format("{0}", status.JSyubai1);
            txtShelfJSyubai2.Text  = String.Format("{0}", status.JSyubai2);
            txtShelfJSyubai3.Text  = String.Format("{0}", status.JSyubai3);

            txtShelfZZaiko.Text    = String.Format("{0}", status.ZZaiko);
            txtShelfZZaiHatsu.Text = String.Format("{0}", status.ZZaiHatsu);
            txtShelfZIso.Text      = String.Format("{0}", status.ZIso);
            txtShelfZHatten.Text   = String.Format("{0}", status.ZHatten);
            txtShelfZSyubai1.Text  = String.Format("{0}", status.ZSyubai1);
            txtShelfZSyubai2.Text  = String.Format("{0}", status.ZSyubai2);
            txtShelfZSyubai3.Text  = String.Format("{0}", status.ZSyubai3);

            foreach (var t in buttontags)
            {
                Enum.SelectStatus.SetText(t.Key, t.Value);
                Enum.SelectStatus.SetEnable(t.Key, t.Value, status.ItemStatus);

                t.Key.Clicked += ButtonSelected;
            }
        }
Ejemplo n.º 2
0
        private void DoWork(object sender, DoWorkEventArgs e)
        {
            DependencyService.Get <ICompleted>().SetListener(this.listener);

            if (e.Argument == null || !(e.Argument is String))
            {
                e.Result = new HttpResult(false);
                return;
            }
            else if (e.Argument != null && e.Argument is String jancode)
            {
                var url = Util.GetURL + HttpUtility.UrlEncode(jancode);
                var r   = client.GetAsync(url).Result;
                var enc = Portable.Text.Encoding.GetEncoding("Shift-JIS");

                using (var stream = (r.Content.ReadAsStreamAsync().Result))
                    using (var reader = (new StreamReader(stream, enc, true)) as TextReader)
                    {
                        try
                        {
                            var t = reader.ReadToEnd();
                            Console.WriteLine(t);
                            this.LatestStatus = JsonConvert.DeserializeObject <ShelfStatus>(t);
                            e.Result          = new HttpResult(true);
                        }
                        catch
                        {
                            e.Result = new HttpResult(false);
                        }
                    }

                return;
            }
        }
Ejemplo n.º 3
0
        public SelectPage(ShelfStatus status = null)
        {
            InitializeComponent();
            this.status = status;

            this.Title = status.ShohinCode;
            NavigationPage.SetBackButtonTitle(this, String.Empty);

            buttontags = new Dictionary <Button, Enum.SelectStatuses>();
            SetTags();

            SetShelfStatus(this.status);
        }