private int getNextOrderNumber() { using (OtherAddress occu = new OtherAddress(true)) { return(occu.getNextOrderNumber()); } }
private void deleteBtn_Click(object sender, EventArgs e) { using (OtherAddress occu = new OtherAddress(true)) { occu.ID = paymentID; //} } }
private void setFieldValsues(OtherAddress addr) { orderNumText.Text = addr.OrderNumber.ToString(); sentaAddressTextbox.Text = addr.Address; numOfMagText.Value = addr.numOfMag; contactNameText.Text = addr.ContactName; mobileText.Text = addr.Mobile; homeTpText.Text = addr.Land; categoryCombo.SelectedIndex = addr.categoryID; }
private void setObjectFromFieldValues(OtherAddress addr) { addr.OrderNumber = Int32.Parse(orderNumText.Text); addr.Address = sentaAddressTextbox.Text; addr.numOfMag = (int)numOfMagText.Value; addr.ContactName = contactNameText.Text; addr.Mobile = mobileText.Text; addr.Land = homeTpText.Text; addr.categoryID = categoryCombo.SelectedIndex; }
private void deleteBtn_Click(object sender, EventArgs e) { using (OtherAddress occu = new OtherAddress(true)) { occu.ID = addressID; //if (MessageView.ShowQuestionMsg("Delete Details of '" + nameTextBoxX.Text + "'") == DialogResult.OK) //{ // occu.Delete(); // clear(); // MessageView.ShowMsg("Sucessfully Deleted"); //} } }
private void addbtn_Click(object sender, EventArgs e) { try { if (ValidateBeforeAdd()) { using (OtherAddress addr = new OtherAddress(true)) { setObjectFromFieldValues(addr); if (addressID == 0) { if (addr.Add() == 1) { // MessageView.ShowMsg("Sucessfully Added"); //errorProvider1.SetError(idTxt, string.Empty); //errorProvider1.SetError(nameTxt, string.Empty); statusText.Visible = true; timer1.Enabled = true; clear(); } } else { addr.ID = addressID; if (MessageView.ShowQuestionMsg("Update Address") == DialogResult.OK) { if (addr.Update() == 1) { MessageView.ShowMsg("Sucessfully Updated"); //errorProvider1.SetError(idTxt, string.Empty); //errorProvider1.SetError(nameTxt, string.Empty); clear(); } } } } } } catch (Exception ex) { MessageView.ShowErrorMsg(ex.Message); } }
public void FillSearchFilds(Hashtable hashtable) { try { addressID = (int)hashtable["ID"]; using (OtherAddress adr = new OtherAddress(true)) { adr.Select(addressID); setFieldValsues(adr); } } catch (Exception ex) { MessageView.ExceptionError(ex); } }
private void findButton_Click(object sender, EventArgs e) { try { using (OtherAddress addre = new OtherAddress(true)) { setObjectFromFieldValues(addre); DataTable ds = addre.SelectFind(); frmSearch frmSub = new frmSearch(ds, this.Text, 3, 50); frmSub.Width = 800; HandleSearch(frmSub); } } catch (Exception ex) { MessageView.ExceptionError(ex); } }
private void addbtn_Click(object sender, EventArgs e) { clear(); if (privateAddressRadio.Checked) { using (MemberAddress memAdd = new MemberAddress(true)) { adressGrid.DataSource = memAdd.SelectForMonth(DateTime.Now, categoryCombo.SelectedIndex); } } else { using (OtherAddress otherAdd = new OtherAddress(true)) { adressGrid.DataSource = otherAdd.SelectForMonth(DateTime.Now, categoryCombo.SelectedIndex); } } setGridRownumber(); }
private void setFieldValsues(OtherAddress addr) { regNumText.Text = addr.OrderNumber.ToString(); amountText.Value = addr.numOfMag; nameText.Text = addr.ContactName; }