private void frmLogincs_Load(object sender, EventArgs e) { string file = Path.Combine(Application.StartupPath, "config\\config.ini"); cfg = new ConfigSetting(file); txtUser.Text = cfg.User; string url = cfg.Server + controllApi; string str = TTX_WebAPI_Helper.getReturnJson(url); ResponseWarehouseEntity rsp = JsonToolEx.ToObject <ResponseWarehouseEntity>(str.Replace("default", "flag")); if (rsp != null && rsp.data != null) { rsm = rsp; if (rsm.data != null && rsm.data.Count > 0) { cbxWarehouse.DataSource = null; cbxWarehouse.DataSource = rsm.data; cbxWarehouse.DisplayMember = "name"; cbxWarehouse.ValueMember = "code"; } } }