private void btnSave_Click(object sender, EventArgs e) { try { if (ValidateForm()) { CorporateClient.CorporateClientWebService obj = new CorporateClient.CorporateClientWebService(); CorporateClientInfo objCorporateClientInfo = new CorporateClientInfo(); objCorporateClientInfo.ClientName = txtCorporateName.Text; objCorporateClientInfo.Address = rchtxtAddress.Text; objCorporateClientInfo.PhoneNumber = txtPhoneNumber.Text; objCorporateClientInfo.EmailAddress = txtCorporateEmail.Text; objCorporateClientInfo.HOAddress = txtHeadOfficeAddress.Text; objCorporateClientInfo.LCDepartment = txtLCDepartment.Text; objCorporateClientInfo.LCDContactPerson = txtLCDContractPerson.Text; objCorporateClientInfo.LCDContactPersonPhone = txtContactPersonPhone.Text; objCorporateClientInfo.LCDContactPersonMobile = txtContactPersonMobile.Text; objCorporateClientInfo.LCDContactPersonEmail = txtContactPersonEmail.Text; objCorporateClientInfo.SLA = rchtxtSLA.Text; int Id = Convert.ToInt32(lblCorporateClientId.Text); if (Id == 0) { objCorporateClientInfo.AddedBy = GetLoginUser.UserName; obj.CorporateClientAdd(objCorporateClientInfo, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens())); MessageBox.Show("Data Saved Successfully..."); } else { objCorporateClientInfo.EditedBy = GetLoginUser.UserName; objCorporateClientInfo.CorporateClientID = Id; obj.CorporateClientUpdate(objCorporateClientInfo, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens())); MessageBox.Show("Data Updated Successfully..."); } ClearField(); this.DialogResult = DialogResult.OK; } } catch (Exception ex) { throw ex; } }
public frmCorporateClient(int corporateClientID) { InitializeComponent(); CorporateClient.CorporateClientWebService objWebService = new CorporateClient.CorporateClientWebService(); CorporateClientInfo objInfo = new CorporateClientInfo(); objInfo.CorporateClientID = corporateClientID; objInfo = objWebService.CorporateClientGetByID(objInfo.CorporateClientID, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens())); lblCorporateClientId.Text = objInfo.CorporateClientID.ToString(); txtCorporateName.Text = objInfo.ClientName; rchtxtAddress.Text = objInfo.Address; txtPhoneNumber.Text = objInfo.PhoneNumber.ToString(); txtCorporateEmail.Text = objInfo.EmailAddress; txtHeadOfficeAddress.Text = objInfo.HOAddress; txtLCDepartment.Text = objInfo.LCDepartment; txtLCDContractPerson.Text = objInfo.LCDContactPerson; txtContactPersonMobile.Text = objInfo.LCDContactPersonMobile; txtContactPersonPhone.Text = objInfo.LCDContactPersonPhone; txtContactPersonEmail.Text = objInfo.LCDContactPersonEmail; rchtxtSLA.Text = objInfo.SLA; }
/// <remarks/> public void CorporateClientUpdateAsync(CorporateClientInfo objCorporateClientInfo, string token, object userState) { if ((this.CorporateClientUpdateOperationCompleted == null)) { this.CorporateClientUpdateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCorporateClientUpdateOperationCompleted); } this.InvokeAsync("CorporateClientUpdate", new object[] { objCorporateClientInfo, token}, this.CorporateClientUpdateOperationCompleted, userState); }
/// <remarks/> public void CorporateClientUpdateAsync(CorporateClientInfo objCorporateClientInfo, string token) { this.CorporateClientUpdateAsync(objCorporateClientInfo, token, null); }
public bool CorporateClientUpdate(CorporateClientInfo objCorporateClientInfo, string token) { object[] results = this.Invoke("CorporateClientUpdate", new object[] { objCorporateClientInfo, token}); return ((bool)(results[0])); }
private void dataGridViewCorporateClient_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridViewCorporateClient.Columns["clmEdit"].Index) { int x = Convert.ToInt32(dataGridViewCorporateClient.CurrentRow.Cells["clmCorporateClientID"].Value.ToString()); frmCorporateClient objFrm = new frmCorporateClient(x); objFrm.ShowDialog(); dataGridViewCorporateClient.DataSource = null; LoadCorporateClient(); } if (e.ColumnIndex == dataGridViewCorporateClient.Columns["clmDelete"].Index) { try { CorporateClient.CorporateClientWebService objWebService = new CorporateClient.CorporateClientWebService(); CorporateClientInfo objInfo = new CorporateClientInfo(); objInfo.CorporateClientID = Convert.ToInt32(dataGridViewCorporateClient.Rows[e.RowIndex].Cells["clmCorporateClientID"].Value.ToString()); if (DialogResult.Yes == MessageBox.Show("Do You Want Delete ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { string deletedBy = GetLoginUser.UserName; objWebService.CorporateClientDeleteByID(objInfo.CorporateClientID,deletedBy, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens())); MessageBox.Show("Data Deleted Successfully"); LoadCorporateClient(); } } catch (Exception ex) { throw ex; } } if (e.ColumnIndex == dataGridViewCorporateClient.Columns["clmContract"].Index) { int x = Convert.ToInt32(dataGridViewCorporateClient.CurrentRow.Cells["clmCorporateClientID"].Value.ToString()); frmContractGrid objGridContract = new frmContractGrid(x); objGridContract.Show(); this.Close(); } }