private void btnCodeSubmit_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtRegCode.Text)) { MessageBox.Show("Please enter registration code."); return; } ClientWorkStation _Client = new dcClientWorkStation2().GetClientByRegCode(txtRegCode.Text); if (_Client.ClientId == 0) { MessageBox.Show("Registration code is invalid, Please check your code and try again."); } else { int WorkStationId = new dcClientWorkStation().UpdateWorkStation(_Client.ClientId); if (WorkStationId > 0) { gbClientReg.Visible = false; tab.Visible = true; btnOpenWebsite.Enabled = true; btnUpdateClient.Visible = true; btnUpdateClient.Enabled = true; _Client.WorkStationId = WorkStationId; ClientWorkStation info = new dcClientWorkStation().GetClientWorkStation(_Client.ClientId, _Client.WorkStationId); new dcClientWorkStation().UpdateLocalClientWorkStation(info); } } } catch (Exception ex) { throw ex; } }
private void btnCodeSubmit_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtRegCode.Text)) { MessageBox.Show("Please enter registration code."); return; } ClientWorkStation _Client = new dcClientWorkStation2().GetClientByRegCode(txtRegCode.Text); if (_Client.ClientId == 0) { MessageBox.Show("Registration code is invalid, Please check your code and try again."); } else { int WorkStationId= new dcClientWorkStation().UpdateWorkStation(_Client.ClientId); if (WorkStationId > 0) { gbClientReg.Visible = false; tab.Visible = true; btnOpenWebsite.Enabled = true; btnUpdateClient.Visible = true; btnUpdateClient.Enabled = true; _Client.WorkStationId = WorkStationId; ClientWorkStation info = new dcClientWorkStation().GetClientWorkStation(_Client.ClientId,_Client.WorkStationId); new dcClientWorkStation().UpdateLocalClientWorkStation(info); } } } catch (Exception ex) { throw ex; } }