Ejemplo n.º 1
0
        //进入时
        private void storeManagementTab_Enter(object sender, EventArgs e)
        {
            if (!storeManagementTab_Entered)
            {
                #region 初始化库存清单

                //创建ProductView
                storeManagementTab_productView = new ProductView();

                //创建tableView并绑定
                storeManagementTab_tableView            = new TableView();
                storeManagementTab_tableView.gridView   = productGridView_00;
                storeManagementTab_tableView.controller = storeManagementTab_productView;

                //创建ViewStoreProduct(JsonSocketModule)
                storeManagementTab_viewStoreProduct      = new ViewStoreProduct();
                storeManagementTab_viewStoreProduct.user = m_user;

                //初始化tableView
                storeManagementTab_tableView.init();

                //给这个tableView绑定事件
                storeManagementTab_tableView.RowSelected += StoreManagementTab_tableView_RowSelected;

                #endregion
            }
            storeManagementTab_Entered = true;

            StoreManagementTab_GetStoreDataFromServer();
        }
Ejemplo n.º 2
0
        public socketTestPage()
        {
            InitializeComponent();

            if (isServer)
            {
                server = new ServerSocketBasement();
                server.Start();
                connectBtn.Enabled       = false;
                requestBtn.Enabled       = false;
                requestIDTextBox.Enabled = false;
                requestIDTextBox.Text    = "Server mode";

                Product pro = new Product();
                pro.productType  = "变频器";
                pro.productClass = "GD10-0R2G-S2-B";
                pro.setMNo("I01161002599");

                Money cny = new Money(10.0);

                User usr = new User();
                usr.userName   = "******";
                usr.userPass   = "******";
                usr.m_userType = userType.USER_SUPERADMIN;

                Store store = serverMainHandler.GetSingleton().GetStore();

                ImportToStore tmp = new ImportToStore();
                tmp.product = pro;
                tmp.cost    = cny;
                tmp.user    = usr;
                tmp.store   = store;

                string req  = tmp.GenerateObjectClient();
                string res1 = tmp.GetObjectServer(req);
                string res2 = tmp.GetObjectServer(req);
                string res3 = tmp.GetObjectServer(req);
                string res4 = tmp.GetObjectServer(req);

                MessageBox.Show("Request: \n" + req + "\n\nResponse1:\n" + res1 + "\n\nResponse2:\n" + res2 + "\n\nResponse3:\n" + res3 + "\n\nResponse4:\n" + res4);
            }
            else
            {
                client = new ClientSocketBasement();

                usr            = new User();
                usr.userName   = "******";
                usr.userPass   = "******";
                usr.m_userType = userType.USER_SUPERADMIN;

                tmp2      = new ViewStoreProduct();
                tmp2.user = usr;
            }
        }