protected void ddlSupplier_OnSelectedIndexChanged(object sender, EventArgs e) { objSupplier = new Supplier(); objSupplierBiz = new SupplierBiz(); objSupplier = objSupplierBiz.GetSupplierDue(ddlSupplier.SelectedValue); txtDueAmount.Text = objSupplier.SupplierDue.ToString(); txtPurchaseGrandTotal.Text = txtDueAmount.Text != "" && txtTotalPurchaseAmount.Text != "" ? (Convert.ToDecimal(txtDueAmount.Text) + Convert.ToDecimal(txtTotalPurchaseAmount.Text)).ToString("N2") : txtTotalPurchaseAmount.Text != "" ? Convert.ToDecimal(txtTotalPurchaseAmount.Text).ToString("N2") : txtDueAmount.Text != "" ? Convert.ToDecimal(txtDueAmount.Text).ToString("N2") : ""; txtCurrentDue.Text = txtPurchaseGrandTotal.Text != "" && txtPaidAmount.Text != "" && txtDiscountAmount.Text != "" ? (Convert.ToDecimal(txtPurchaseGrandTotal.Text) - Convert.ToDecimal(txtPaidAmount.Text) - Convert.ToDecimal(txtDiscountAmount.Text)).ToString("N2") : txtPurchaseGrandTotal.Text != "" && txtPaidAmount.Text != "" ? (Convert.ToDecimal(txtPurchaseGrandTotal.Text) - Convert.ToDecimal(txtPaidAmount.Text)).ToString("N2") : txtPurchaseGrandTotal.Text != "" ? (Convert.ToDecimal(txtPurchaseGrandTotal.Text)).ToString("N2") : ""; }
protected void txtInvoiceNumberList_OnTextChanged(object sender, EventArgs e) { objPurchaseLedger = new PurchaseLedger(); objPurchaseLedgerBiz = new PurchaseLedgerBiz(); objPurchaseLedger = objPurchaseLedgerBiz.GetSingleInvoiceDetail(txtInvoiceNumber.Text.Trim()); ddlSupplier.SelectedValue = objPurchaseLedger.SupplierId.ToString(); txtInvoiceDue.Text = objPurchaseLedger.DueAmount.ToString(); objSupplier = new Supplier(); objSupplierBiz = new SupplierBiz(); objSupplier = objSupplierBiz.GetSupplierDue(ddlSupplier.SelectedValue); txtTotalBalance.Text = objSupplier.SupplierDue.ToString(); ddlReceivingType.Attributes.Add("onfocus", "this.select()"); ddlReceivingType.Focus(); }