Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string name = txtCompanyName.Text.Trim();
            string code = txtCompanyCode.Text.Trim();
            ServerBusinesses sb = new ServerBusinesses();

            _addCompanieThread = new Thread(() =>
            {
                this.Invoke(new Action(() =>
                {
                    btnSave.Enabled = false;
                    if (_service.AddCompany(name,code))
                    {
                        btnSave.Visible = true;
                        UserUtils.ShowInfo("添加公司成功");
                    }
                    else
                    {
                        UserUtils.ShowError("添加公司失败");
                    }

                    btnSave.Enabled = true;
                }));
            });
            _addCompanieThread.IsBackground = true;
            _addCompanieThread.Start();
        }
Ejemplo n.º 2
0
 public bool AddCompany(string companyName, string companyCode)
 {
     ServerBusinesses sb = new ServerBusinesses();
     return sb.AddCompany(companyName, companyCode);
 }