Exemple #1
0
        private void LoadItems()
        {
            string h = Pman.GenerateNewHash();

            Pman.RequestSend     += Pman_RequestSend;
            Pman.ResponseRecieve += Pman_ResponseRecieve;
            Pman.Error           += Pman_Error;

            string getResult = Pman.Get("Product?hash=" + h + "&parentId=0&order=&ascending=&term=&mode=&status=&fields=&filtersand&filtersor", "GET", null);

            List <GCMSTests.Classes.Item> rsDer = GCMSTests.Classes.Base.Deserialise <List <GCMSTests.Classes.Item> >(getResult);

            this.listView1.Items.Clear();
            foreach (var it in rsDer)
            {
                ListViewItem lvi = new ListViewItem()
                {
                    Text = it.Id.ToString(), Tag = it
                };
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.Code));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.Name));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.DefaultPrice.ToString()));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.DefaultStock.ToString()));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.DefaultMinStock.ToString()));
                this.listView1.Items.Add(lvi);
            }

            /*this.treeView1.Nodes.Clear();
             * LoadTree(0, rsDer, null);
             */
            Pman.RequestSend     -= Pman_RequestSend;
            Pman.ResponseRecieve -= Pman_ResponseRecieve;
            Pman.Error           -= Pman_Error;
        }
Exemple #2
0
        protected void LoadCats()
        {
            string h = Pman.GenerateNewHash();

            Pman.RequestSend     += Pman_RequestSend;
            Pman.ResponseRecieve += Pman_ResponseRecieve;
            Pman.Error           += Pman_Error;

            string getResult = Pman.Get("Category?hash=" + h + "&parentId=0", "GET", null);

            List <GCMSTests.Classes.Item> rsDer = GCMSTests.Classes.Base.Deserialise <List <GCMSTests.Classes.Item> >(getResult);

            this.treeView1.Nodes.Clear();
            LoadTree(0, rsDer, null);
            Pman.RequestSend     -= Pman_RequestSend;
            Pman.ResponseRecieve -= Pman_ResponseRecieve;
            Pman.Error           -= Pman_Error;
        }
Exemple #3
0
        private void LoadItems()
        {
            string h = Pman.GenerateNewHash();

            Pman.RequestSend     += Pman_RequestSend;
            Pman.ResponseRecieve += Pman_ResponseRecieve;
            Pman.Error           += Pman_Error;

            string getResult = Pman.Get("/Order?status=&hash=" + h + "&from&to", "GET", null);

            List <GCMSTests.Classes.Sale> rsDer = GCMSTests.Classes.Base.Deserialise <List <GCMSTests.Classes.Sale> >(getResult);

            this.listView1.Items.Clear();
            foreach (var it in rsDer)
            {
                ListViewItem lvi = new ListViewItem()
                {
                    Text = it.Id.ToString(), Tag = it
                };
                //  lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.Id.ToString()));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.CreationDate.ToString()));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.UserData.EMail));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.UserData.FirstName + it.UserData.LastName));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.Status.ToString()));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.Total.ToString()));
                lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, it.PayMethod.Name));
                this.listView1.Items.Add(lvi);
            }

            /*this.treeView1.Nodes.Clear();
             * LoadTree(0, rsDer, null);
             */
            Pman.RequestSend     -= Pman_RequestSend;
            Pman.ResponseRecieve -= Pman_ResponseRecieve;
            Pman.Error           -= Pman_Error;
        }
Exemple #4
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            if (this.Item == null)
            {
                /*default data*/
                this.Item               = new Classes.Item();
                Item.AutoMeta           = true;
                Item.Brand              = string.Empty;
                Item.Sync               = true;
                Item.SyncPrice          = true;
                Item.Id                 = 0;
                Item.Author             = string.Empty;
                Item.ContentDisplay     = 0;
                Item.ContentOrder       = 0;
                Item.ContentRecsPerPage = 0;
                Item.ContentSort        = true;
                Item.IncludeOnRss       = true;
                Item.IncludeOnSitemap   = true;
                Item.IsCombo            = false;
                Item.UnitsMultiplier    = 1;
                Item.Vigency            = false;
                Item.MetaLang           = string.Empty;
            }

            this.Item.Name = this.ItemName.Text;
            if (this.Item.Id == 0)
            {
                this.Item.Code     = this.Code.Text;
                this.Item.AutoMeta = true;
            }
            this.Item.ParentId     = int.Parse(this.ParentId.Text);
            Item.BoxHeight         = (!string.IsNullOrEmpty(BoxHeight.Text) ? (decimal?)decimal.Parse(BoxHeight.Text.Replace(",", "."), System.Globalization.CultureInfo.InvariantCulture) : null);
            Item.BoxLength         = (!string.IsNullOrEmpty(BoxLength.Text) ? (decimal?)decimal.Parse(BoxLength.Text.Replace(",", "."), System.Globalization.CultureInfo.InvariantCulture) : null);
            Item.BoxWeight         = (!string.IsNullOrEmpty(BoxWeight.Text) ? (decimal?)decimal.Parse(BoxWeight.Text.Replace(",", "."), System.Globalization.CultureInfo.InvariantCulture) : null);
            Item.BoxWidth          = (!string.IsNullOrEmpty(BoxWidth.Text) ? (decimal?)decimal.Parse(BoxWidth.Text.Replace(",", "."), System.Globalization.CultureInfo.InvariantCulture) : null);
            Item.DefaultMinStock   = int.Parse(DefaultMinStock.Text);
            Item.DefaultOfferPrice = (!string.IsNullOrEmpty(DefaultOfferPrice.Text) ? (decimal?)decimal.Parse(DefaultOfferPrice.Text.Replace(",", "."), System.Globalization.CultureInfo.InvariantCulture) : null);
            Item.DefaultPrice      = decimal.Parse(DefaultPrice.Text.Replace(",", "."), System.Globalization.CultureInfo.InvariantCulture);
            Item.DefaultStock      = int.Parse(DefaultStock.Text);
            Item.Description       = Description.Text;
            Item.ForSale           = ForSale.Checked;
            Item.FreeShipping      = FreeShipping.Checked;
            Item.Keywords          = this.Keywords.Text;

            string h = Pman.GenerateNewHash();

            Pman.RequestSend     += Pman_RequestSend;
            Pman.ResponseRecieve += Pman_ResponseRecieve;
            Pman.Error           += Pman_Error;
            string getResult = string.Empty;

            if (Item.Id > 0)
            {
                getResult = Pman.Get("Product/" + Item.Id.ToString() + "?hash=" + h, "PUT", Item.ToString());
            }
            else
            {
                getResult = Pman.Get("Product/?hash=" + h, "POST", Item.ToString());
            }

            Item = GCMSTests.Classes.Base.Deserialise <GCMSTests.Classes.Item>(getResult);


            Pman.RequestSend     -= Pman_RequestSend;
            Pman.ResponseRecieve -= Pman_ResponseRecieve;
            Pman.Error           -= Pman_Error;
        }