private void btnOk_Click(object sender, EventArgs e) { if (Id == 0) { card.CreatedDate = DateTime.Now; card.CreatedBy = StaticData.CurrentUserId; } card = bindTool.DataObject; //card.CardTypeId = Convert.ToByte(lookUpCardType.EditValue); //card.CardNumber = txtCardCode.Text; //card.CardName = txtCardName.Text; //card.CurrencyId = Convert.ToByte(lookUpCurrency.EditValue); //card.Phone1 = txtTel1.Text; //card.Phone2 = txtTel2.Text; //card.Phone3 = txtTel3.Text; //card.TaxCode = txtTaxCode.Text; //card.Country = txtCountry.Text; //card.City = txtCity.Text; //card.Town = txtTown.Text; //card.District = txtDistrict.Text; //card.LocationAddress = txtLocationAddress.Text; //card.DebtLimit = spDebtLimit.Value; //card.IsActive = chkActive.Checked; Operation <Card> operation = OperationHandler.PostCard(card); if (operation.Successful) { this.Close(); } lblError.Text = operation.Fail; }