protected void SaveInvoice() { BLL_TRV_Invoice objInvoice = new BLL_TRV_Invoice(); try { if (txtInvNo.Text.Trim() == "" || txtInvAmount.Text.Trim() == "" || txtInvDueDate.Text.Trim() == "") { Response.Write("<script type='text/javascript'>alert('Invoice Number, Amount and Due Date are MANDATORY');</script>"); } else { foreach (GridViewRow gvR in grdInvoice.Rows) { CheckBox chkSelect = ((CheckBox)gvR.FindControl("chkSelect")); HiddenField hdnRequestID = ((HiddenField)gvR.FindControl("hdnRequestID")); if (chkSelect != null && hdnRequestID != null) { if (chkSelect.Checked == true) { int RequestID = UDFLib.ConvertToInteger(hdnRequestID.Value); objInvoice.Save_Invoice(RequestID, txtInvNo.Text, Convert.ToDateTime(txtInvDueDate.Text), UDFLib.ConvertToDecimal(txtInvAmount.Text), cmbCurrency.SelectedValue, Convert.ToDateTime(txtInvDueDate.Text), UDFLib.ConvertToInteger(Session["USERID"].ToString()), txtInvoiceRemarks.Text); } } } } } catch { } finally { objInvoice = null; } }
protected void grd_Invoice_RowCommand(object source, GridViewCommandEventArgs e) { if (e.CommandName == "PAID") { BLL_TRV_Invoice objInvoice = new BLL_TRV_Invoice(); try { objInvoice.Save_Invoice(Convert.ToInt32(e.CommandArgument), UDFLib.ConvertToInteger(Session["USERID"].ToString())); GetInvoices(ViewState["STATUS"].ToString()); } catch { } finally { objInvoice = null; } } }
protected void GetInvoices(string status) { BLL_TRV_Invoice objInvoice = new BLL_TRV_Invoice(); try { int VCode = 0; if (!String.IsNullOrEmpty(cmbVessel.SelectedValue)) { VCode = Convert.ToInt32(cmbVessel.SelectedValue); } DataSet ds = objInvoice.Get_Request_For_Invoice(Convert.ToInt32(cmbFleet.SelectedValue), VCode, Convert.ToInt32(cmbSupplier.SelectedValue), txtTrvDateFrom.Text, txtTrvDateTo.Text, status, UDFLib.ConvertToInteger(Session["USERID"].ToString())); grdInvoice.DataSource = ds; grdInvoice.DataBind(); } catch { } finally { objInvoice = null; } }
protected void SaveInvoice() { BLL_TRV_Invoice objInvoice = new BLL_TRV_Invoice(); try { if (txtInvNo.Text.Trim() == "" || txtInvAmount.Text.Trim() == "" || txtInvDueDate.Text.Trim() == "") { Response.Write("<script type='text/javascript'>alert('Invoice Number, Amount and Due Date are MANDATORY');</script>"); } else { objInvoice.Save_Invoice(RequestID, txtInvNo.Text, Convert.ToDateTime(txtInvDueDate.Text), UDFLib.ConvertToDecimal(txtInvAmount.Text), cmbCurrency.SelectedValue, Convert.ToDateTime(txtInvDueDate.Text), UDFLib.ConvertToInteger(Session["USERID"].ToString()), txtInvoiceRemarks.Text); grdFiles.DataBind(); } } catch { } finally { objInvoice = null; } }