public Winform_VendorDetails(Vendor vendor) { InitializeComponent(); this._vendor = vendor; txtName.Text = _vendor.Name; txtMobNo.Text = _vendor.MobileNo; txtPhoneNo.Text = _vendor.PhoneNo; txtAddress.Text = _vendor.Address; txtTin.Text = _vendor.TIN; txtPLP.Text = _vendor.PLP; txtCST.Text = _vendor.CST; txtBankUserName.Text = _vendor.BankUserName; txtIfscCode.Text = _vendor.IFSCCode; txtAccNo.Text = _vendor.AccNo; //cmbBankName.Text = _vendor.BankName; udDuration.Value = _vendor.DurationCount; if (_vendor.DurationTerm) rdbDays.Checked = true; else rdbMonth.Checked = true; }
public void SaveVendorsList_Test(string name, string mobno, string phoneno, string address, string bankusername, string accno, string bankname, string IfscNo, int dCount, bool inDays, string tin = "", string plp = "", string cst = "") { Vendor vendor = new Vendor(name, mobno, phoneno, address, bankname, accno, IfscNo, dCount, inDays, tin, plp, cst); bool response = PeoplePracticeSaver.SaveVendorInfo(vendor); Assert.AreEqual(true, response); }
protected override void SaveToolStrip_Click(object sender, EventArgs e) { List<string> exceptionList = new List<string> { "txtCST", "txtPLP", "txtTin", "txtPhoneNo", "txtMobNo", "txtBankUserName", "txtIfscCode", "txtAccNo", "cmbBankName" }; if (Utilities.Validation.IsNullOrEmpty(this, true, exceptionList)) return; UpdateStatus("fetching Vendor Details..", 33); if (this._vendor == null) this._vendor = new Vendor(); _vendor.BankUserName = txtBankUserName.Text; if (!IsNullOrEmpty(cmbBankName.Text) && !PeoplePracticeBuilder.IfBankExits(cmbBankName.Text)) this._vendor.Bank = new Bank(cmbBankName.Text); else if (!string.IsNullOrEmpty(cmbBankName.Text)) this._vendor.Bank = PeoplePracticeBuilder.GetBankNames(cmbBankName.Text); _vendor.IFSCCode = txtIfscCode.Text; _vendor.AccNo = txtAccNo.Text; _vendor.Name = txtName.Text; _vendor.Address = txtAddress.Text; _vendor.MobileNo = txtMobNo.Text; _vendor.PhoneNo = txtPhoneNo.Text; _vendor.TIN = txtTin.Text; _vendor.PLP = txtPLP.Text; _vendor.CST = txtCST.Text; _vendor.DurationCount = int.Parse(udDuration.Value.ToString()); _vendor.DurationTerm = rdbDays.Checked; UpdateStatus("Saving..", 66); bool response = PeoplePracticeSaver.SaveVendorInfo(this._vendor); if (response) { UpdateStatus("Saved.", 100); this.Close(); } else UpdateStatus("Error Saving Vendor Details.", 100); //Winform_VendorsRegister addSaleReg = Application.OpenForms["Winform_VendorsRegister"] as Winform_VendorsRegister; //if (addSaleReg != null) // addSaleReg.LoadDgv(); }
protected override void dgvRegister_CellContentClick(object sender, DataGridViewCellEventArgs e) { DialogResult _dialogResult = MessageBox.Show("Do you want to Add Vendor " + Convert.ToString(dgvRegister.Rows[e.RowIndex].Cells["Name"].Value), "Add Vendor Details", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (_dialogResult == DialogResult.No) return; Vendor _vend = new Vendor(); var ID = dgvRegister.Rows[e.RowIndex].Cells["ID"].Value; _vend = PeoplePracticeBuilder.GetVendorInfo(int.Parse(ID.ToString())); Winform_PurchaseBill purchaseBill = Application.OpenForms["Winform_PurchaseBill"] as Winform_PurchaseBill; if (purchaseBill != null) purchaseBill.UpdateVendorControls(_vend); this.Close(); }
public static bool SaveVendorInfo(Vendor vendor) { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { try { session.SaveOrUpdate(vendor); transaction.Commit(); return true; } catch (Exception ex) { transaction.Rollback(); log.Error(ex); return false; } } } }
public void UpdateVendorControls(Vendor _vend) { this.vend = _vend; txtVendorName.Text = _vend.Name; errorProvider1.SetError(txtVendorName, ""); }