protected void LinkButton_Invoice_Id_No_Outgoing_Command(object sender, CommandEventArgs e) { LinkButton linkb = (LinkButton)sender; GridViewRow row = (GridViewRow)linkb.NamingContainer; if (row != null && row.RowIndex != -1 && row.RowIndex != GridView_Outgoing_Invoices.SelectedIndex) { GridView_Outgoing_Invoices.SelectRow(row.RowIndex); } ((RadioButton)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("deals_radio_outg")).Checked = true; String forwardString = "/Pages/Popups/Sale/Inv_Details.aspx"; String invId = ((Label)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("Label_Inv_Id_Hidden")).Text; String rfqId = ((Label)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("Label_rfq_Id_Hidden")).Text; String poId = BackEndObjects.PurchaseOrder.getPurchaseOrderforRFQIdDB(rfqId).getPo_id(); forwardString += "?rfId=" + rfqId; forwardString += "&context=" + "vendInvoiceGrid"; forwardString += "&poId=" + poId; forwardString += "&invId=" + invId; ScriptManager.RegisterStartupScript(this, typeof(string), "DispInvforContactOutgoing", "window.open('" + forwardString + "',null,'resizeable=yes,scrollbars=yes,addressbar=no,toolbar=no,width=1000,Height=900');", true); }
protected void GridView_Outgoing_Invoices_RadioSelect(object sender, EventArgs e) { RadioButton linkb = (RadioButton)sender; GridViewRow row = (GridViewRow)linkb.NamingContainer; if (row != null && row.RowIndex != -1) { GridView_Outgoing_Invoices.SelectRow(row.RowIndex); } }
protected void LinkButton_Pmnt_Det_Outgoing_Command(object sender, CommandEventArgs e) { LinkButton linkb = (LinkButton)sender; GridViewRow row = (GridViewRow)linkb.NamingContainer; if (row != null && row.RowIndex != -1 && row.RowIndex != GridView_Outgoing_Invoices.SelectedIndex) { GridView_Outgoing_Invoices.SelectRow(row.RowIndex); } ((RadioButton)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("deals_radio_outg")).Checked = true; String forwardString = "/Pages/Popups/Purchase/Inv_Payment_Details.aspx"; forwardString += "?rfId=" + ((Label)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("Label_rfq_Id_Hidden")).Text; forwardString += "&context=" + "vendor"; forwardString += "&invId=" + ((Label)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("Label_Inv_Id_Hidden")).Text; forwardString += "&invNo=" + ((LinkButton)GridView_Outgoing_Invoices.SelectedRow.Cells[0].FindControl("LinkButton_Invoice_Id_No_Outgoing")).Text; ScriptManager.RegisterStartupScript(this, typeof(string), "DispInvPmntContactDealsOutgoing", "window.open('" + forwardString + "',null,'resizeable=yes,scrollbars=yes,addressbar=no,toolbar=no,width=900,Height=700');", true); }
protected void fillOutoingInvGrid(ArrayList invList) { String[] contactEntId = Request.QueryString.GetValues("contactId"); if (invList == null || invList.Count == 0) { invList = BackEndObjects.Invoice.getAllInvoicesbyRespEntId(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()); } DataTable dt = new DataTable(); dt.Columns.Add("rfqId"); dt.Columns.Add("InvId"); dt.Columns.Add("InvNo"); dt.Columns.Add("totalAmnt"); dt.Columns.Add("InvDate"); dt.Columns.Add("pmntStat"); dt.Columns.Add("totalPending"); DateUtility dU = new DateUtility(); int counter = 0; for (int i = 0; i < invList.Count; i++) { BackEndObjects.Invoice invObj = (BackEndObjects.Invoice)invList[i]; //Filter out invoices whicha re meant for this contact only BackEndObjects.RFQDetails rfqObj = BackEndObjects.RFQDetails.getRFQDetailsbyIdDB(invObj.getRFQId()); if (rfqObj != null && rfqObj.getEntityId() != null && rfqObj.getEntityId().Equals(contactEntId[0])) { float totalPendingAmnt = 0; float totalClearedAmnt = 0; Dictionary <String, Payment> pmntDict = BackEndObjects.Payment.getPaymentDetailsforInvoiceDB(invObj.getInvoiceId()); foreach (KeyValuePair <String, Payment> kvp in pmntDict) { BackEndObjects.Payment pmntObj = kvp.Value; totalClearedAmnt += pmntObj.getClearingStat().Equals(BackEndObjects.Payment.PAYMENT_CLEARING_STAT_CLEAR) ? pmntObj.getAmount() : 0; } totalPendingAmnt = invObj.getTotalAmount() - totalClearedAmnt; dt.Rows.Add(); dt.Rows[counter]["rfqId"] = invObj.getRFQId(); dt.Rows[counter]["InvId"] = invObj.getInvoiceId(); dt.Rows[counter]["InvNo"] = invObj.getInvoiceNo() != null && !invObj.getInvoiceNo().Equals("") ? invObj.getInvoiceNo() : invObj.getInvoiceId(); dt.Rows[counter]["totalAmnt"] = invObj.getTotalAmount(); dt.Rows[counter]["InvDate"] = dU.getConvertedDate(invObj.getInvoiceDate().Substring(0, invObj.getInvoiceDate().IndexOf(" "))); dt.Rows[counter]["pmntStat"] = invObj.getPaymentStatus(); dt.Rows[counter]["totalPending"] = totalPendingAmnt; counter++; } } GridView_Outgoing_Invoices.Visible = true; GridView_Outgoing_Invoices.DataSource = dt; GridView_Outgoing_Invoices.DataBind(); GridView_Outgoing_Invoices.SelectedIndex = -1; Session[SessionFactory.ALL_CONTACT_ALL_DEAL_OUTGOING_INV_GRID] = dt; Session[SessionFactory.ALL_CONTACT_ALL_DEAL_OUTGOING_INV_ARRAYLIST] = invList; }
protected void GridView_Outgoing_Invoices_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView_Outgoing_Invoices.PageIndex = e.NewPageIndex; GridView_Outgoing_Invoices.DataSource = (DataTable)Session[SessionFactory.ALL_CONTACT_ALL_DEAL_OUTGOING_INV_GRID]; GridView_Outgoing_Invoices.DataBind(); }