Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (this.checkConfigValid())
            {
                if (!this.copyProductPic())
                {
                    return;
                }

                bool bR = MemoryTable.AddNewConfig(
                    this.txtProductType.Text,
                    this.picName,
                    productWidth,
                    productHeight,
                    minCount,
                    this.txtProductName.Text,
                    red, green, blue,
                    this.txtDescription.Text
                    );
                if (bR == true)
                {
                    this.btnAdd.Enabled = false;
                    this.refreshTypeList();
                }
            }
        }
Esempio n. 2
0
        void helper_RequestCompleted_get_category_list(object o)
        {
            string strres = (string)o;

            Debug.WriteLine(
                string.Format("helper_RequestCompleted_get_category_list  ->  = {0}"
                              , strres));
            object olist = fastJSON.JSON.Instance.ToObjectList(strres, typeof(List <ProductCategory>), typeof(ProductCategory));
            List <ProductCategory> resList = (List <ProductCategory>)olist;

            if (resList.Count > 0)
            {
                for (int i = 0; i < resList.Count; i++)
                {
                    ProductCategory pc = resList[i];
                    MemoryTable.AddNewConfig(
                        pc.category_id,
                        pc.category_image,
                        default_image_width,
                        default_image_height,
                        default_min_count,
                        pc.category_name,
                        (int)default_product_color.R, (int)default_product_color.G, default_product_color.B,
                        "尚未设置"
                        );
                }
            }

            //deleControlInvoke dele = delegate(object ol)
            //{

            //};
            //this.Invoke(dele, olist);
            ResSyncer rs = new ResSyncer();

            rs.start_sync("ProductCategory");
        }