private void AddUpdate() { try { using (MemberInfo memInfo = new MemberInfo(true)) { if (ValidateBeforeAdd(memInfo)) { memInfo.Name = nameTextBoxX.Text; memInfo.Address = addressTextbox.Text; memInfo.Mobile = mobileText.Text; memInfo.HomeTP = homeTpText.Text; memInfo.Email = emailText.Text; memInfo.regNumber = indexText.Text; memInfo.DataVerified = verifiedCheck.Checked ? 1 : 0; memInfo.Amount = (int)amountTxt.Value; memInfo.bank = (DBCore.Banks)bankCombo.SelectedIndex + 1; memInfo.paymentType = (DBCore.PaymentType)paymentTypeCombo.SelectedIndex + 1; memInfo.subscriptionType = (DBCore.SubscriptionType)subscriptionTypeCombo.SelectedIndex + 1; memInfo.nameInMag = nameInmagText.Text; memInfo.numOfMagazine = (int)numOfMag.Value; memInfo.Note = note; addAddressToObject(memInfo); if (memberID == 0) { if (memInfo.Add() == 1) { ShowStatus("Successfully Added"); nextIndex = memInfo.GetNextIndex(); clear(); } } else { memInfo.ID = memberID; if (MessageView.ShowQuestionMsg("Update Member info") == DialogResult.OK) { if (memInfo.Update() == 1) { ShowStatus("Successfully Updated"); clear(); } } } } } // SetIndexField(); } catch (Exception ex) { MessageView.ShowErrorMsg(ex.Message); } }
protected BindValue(GameObject pGameObject, string pString) { Source = pGameObject; var strings = pString.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries); ComponentType = new SType(pGameObject .GetComponents(typeof(Component)) .Select(c => c.GetType()) .Single(t => t.Name == strings[0])); MemberInfo.Add( new SMemberInfo( ComponentType.Value.GetMember(strings[1]).Single() )); }
private void addbtn_Click(object sender, EventArgs e) { try { using (MemberInfo memInfo = new MemberInfo(true, memberType)) { if (ValidateBeforeAdd(memInfo)) { memInfo.NIC = nicText.Text; memInfo.BloodGroup = bloodGroupCombo.Text; memInfo.Name = nameTextBoxX.Text; memInfo.Address = addressTextbox.Text; memInfo.DOB = dobDate.Value.Date; memInfo.Mobile = mobileText.Text; memInfo.HomeTP = homeTpText.Text; memInfo.Email = emailText.Text; memInfo.Occupatition = occuCombo.SelectedValue == null ? -1 : (int)occuCombo.SelectedValue; memInfo.OccupatitioInfo = occuText.Text; memInfo.DOJoinAsapuwa = dojoindate.Value.Date; memInfo.Abilities = abilityText.Text; memInfo.Contributition = contribText.Text; memInfo.IndexNumber = indexText.Text; memInfo.School = schoolCombo.SelectedValue == null ? -1 : (int)schoolCombo.SelectedValue; memInfo.EduQualifications = eduQuaCombo.SelectedValue == null ? -1 : (int)eduQuaCombo.SelectedValue; memInfo.OtherQualifications = otheQualiText.Text; memInfo.DataVerified = verifiedCheck.Checked ? 1 : 0; if (bloodGroupCombo.SelectedItem != null) { ComboItem item = (ComboItem)bloodGroupCombo.SelectedItem; memInfo.BloodGroup = item.Text; } memInfo.Sex = sexCombo.SelectedIndex; memInfo.CivilStatus = civilStatusCombo.SelectedIndex; if (imageData == null) { memInfo.ImageData = string.Empty; } else { memInfo.ImageData = Utility.Get64String(imageData); } if (memberID == 0) { addTagsToObject(memInfo); if (memInfo.Add() == 1) { MessageView.ShowMsg("Sucessfully Added"); nextIndex = memInfo.GetNextIndex(); clear(); } } else { memInfo.ID = memberID; if (MessageView.ShowQuestionMsg("Update Member info") == DialogResult.OK) { if (memInfo.Update() == 1) { MessageView.ShowMsg("Sucessfully Updated"); //errorProvider1.SetError(idTxt, string.Empty); //errorProvider1.SetError(nameTxt, string.Empty); clear(); } } } } } // SetIndexField(); } catch (Exception ex) { MessageView.ShowErrorMsg(ex.Message); } }