protected void fillRespQuoteGrid() { DataTable dt = new DataTable(); dt.Columns.Add("RespCompId"); dt.Columns.Add("VendName"); dt.Columns.Add("quote"); dt.Columns.Add("NDA"); dt.Columns.Add("DateVal"); dt.Columns.Add("comm"); dt.Columns.Add("TotalAmnt"); dt.Columns.Add("DealReq"); ArrayList shortListedList = RFQShortlisted. getAllShortListedEntriesbyRFQId(Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString()); DateUtility dU = new DateUtility(); for (int i = 0; i < shortListedList.Count; i++) { RFQShortlisted shortObj = (RFQShortlisted)shortListedList[i]; dt.Rows.Add(); dt.Rows[i]["RespCompId"] = shortObj.getRespEntityId(); dt.Rows[i]["VendName"] = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(shortObj.getRespEntityId()).getEntityName(); dt.Rows[i]["DateVal"] = dU.getConvertedDate(shortObj.getCreatedDate()); dt.Rows[i]["TotalAmnt"] = shortObj.getPotenAmnt(); dt.Rows[i]["DealReq"] = shortObj.getFinlSupFlag(); } GridView_RFQ_Resp_Quotes.DataSource = dt; GridView_RFQ_Resp_Quotes.DataBind(); GridView_RFQ_Resp_Quotes.Columns[1].Visible = false; //Find out the selected entity if any RFQShortlisted selectedPotObj = RFQShortlisted. getRFQShortlistedEntryforFinalizedVendor(Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString()); Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SHORLISTED_FINALIZED_POTEN] = selectedPotObj.getPotentialId(); foreach (GridViewRow gVR in GridView_RFQ_Resp_Quotes.Rows) { if (((Label)gVR.Cells[0].FindControl("Label_Hidden")).Text.Equals(selectedPotObj.getRespEntityId())) { ((System.Web.UI.WebControls.Image)gVR.Cells[0].FindControl("Image_Selected")).Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String rfId = Request.QueryString.GetValues("rfId")[0]; String context = Request.QueryString.GetValues("context")[0]; String poId = Request.QueryString.GetValues("poId")[0]; String otherEntId = ""; //This flag determines whether or no any tax component is changed in this screen Label_Inv_Tax_Comp_Changed.Text = "N"; String invId = Request.QueryString.GetValues("invId")[0]; BackEndObjects.Invoice invObj = new BackEndObjects.Invoice(); if (invId != null && !invId.Equals("")) { invObj = BackEndObjects.Invoice.getInvoicebyIdDB(invId); loadAlreadyCreatedInvData(invObj); } else { //If invoice data does not exist then forward to create invoice screen String forwardString = "/Pages/createInvoice.aspx"; forwardString += "?rfId=" + rfId; if (poId == null || poId.Equals("")) { forwardString += "&emptySO=" + "true"; } Response.Redirect(forwardString); //Server.Transfer(forwardString); //ScriptManager.RegisterStartupScript(this, typeof(string), "createInv", "window.open('" + forwardString + "',null,'resizeable=yes,scrollbars=yes,addressbar=no,toolbar=no,width=900,Height=900');", true); } // Button_Update_Inv.Visible = false; RFQShortlisted rfqDealObj = BackEndObjects.RFQShortlisted.getRFQShortlistedEntryforFinalizedVendor(rfId); if (context.Equals("client") || context.Equals("clientInvoiceGrid")) { otherEntId = rfqDealObj.getRespEntityId(); //If control is in client context, then the invoice is already created and the response entity details are available if (otherEntId == null || otherEntId.Equals("")) { otherEntId = invObj.getRespEntityId(); } } else { bool approvalContext = false; if (Request.QueryString.GetValues("approvalContext") != null) { approvalContext = Request.QueryString.GetValues("approvalContext")[0].Equals("Y") ? true : false; } if (approvalContext) { Button_Create_Inv.Enabled = false; Button_Update_Inv.Enabled = false; Label_INV_Creation_Stat.Visible = true; Label_INV_Creation_Stat.Text = "To edit anything for this invoice, please check the invoice from Sales->Invoice screen."; Label_INV_Creation_Stat.ForeColor = System.Drawing.Color.Red; } else { Dictionary <String, bool> accessList = (Dictionary <String, bool>)Session[SessionFactory.ACCESSLIST_FOR_USER]; if (!accessList[BackEndObjects.EntityAccessListRecord.ENTITY_ACCESS_LIST_RECORD_ACCESS_EDIT_INVOICE_SALES] && !accessList[BackEndObjects.EntityAccessListRecord.ENTITY_ACCESS_LIST_RECORD_ACCESS_OWNER_ACCESS]) { Label_INV_Creation_Stat.Visible = true; Label_INV_Creation_Stat.Text = "You don't have edit access to invoice record"; Label_INV_Creation_Stat.ForeColor = System.Drawing.Color.Red; Button_Create_Inv.Enabled = false; Button_Update_Inv.Enabled = false; } } otherEntId = RFQDetails.getRFQDetailsbyIdDB(rfId).getEntityId(); } loadClientAndVendorDetails(rfId, otherEntId); loadProductGrid(poId); populateLogo(otherEntId, context); loadInvTaxCompGrid(invId); loadTnC(invObj); updateTotalINVAmount(); if (context.Equals("client") || context.Equals("clientInvoiceGrid")) { disableControlsForClient(); } } }