Exemple #1
0
        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;
                }
            }
        }
Exemple #2
0
        protected void Button_Finalz_Deal_Click(object sender, EventArgs e)
        {
            String respEntityId = Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SHOW_QUOTE_SELECTED_RESP_ENTITY_ID].ToString();
            String rfqId        = Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString();

            RFQShortlisted rfqShortObj = RFQShortlisted.getRFQShortlistedbyRespEntandRFQId(respEntityId, rfqId);

            //Allow only if the supplier finalized the deal
            if (rfqShortObj.getFinlSupFlag().Equals("Y"))
            {
                Dictionary <String, String> whereCls = new Dictionary <string, string>();
                whereCls.Add(BackEndObjects.RFQShortlisted.RFQ_SHORTLIST_COL_RFQ_ID, rfqId);
                whereCls.Add(BackEndObjects.RFQShortlisted.RFQ_SHORTLIST_COL_RESP_ENT_ID, respEntityId);

                Dictionary <String, String> targetVals = new Dictionary <string, string>();
                targetVals.Add(BackEndObjects.RFQShortlisted.RFQ_SHORTLIST_COL_FINL_BY_CUST, "Y");

                try
                {
                    BackEndObjects.RFQShortlisted.updateRFQShortListedEntryDB(targetVals, whereCls, DBConn.Connections.OPERATION_UPDATE);
                    Label_Finalize_Stat.Visible   = true;
                    Label_Finalize_Stat.ForeColor = System.Drawing.Color.Green;
                    Label_Finalize_Stat.Text      = "Deal Finalization Request Sent";

                    String forwardString = "/Pages/Popups/Purchase/FinalizeDeal.aspx";
                    forwardString += "?respCompId=" + respEntityId + "&rfqId=" + rfqId + "&context=" + "client";

                    Button_Finalz_Deal.Enabled = false;
                    Response.Redirect(forwardString);
                    //Server.Transfer(forwardString);
                }
                catch (Exception ex)
                {
                    Label_Finalize_Stat.Visible   = true;
                    Label_Finalize_Stat.ForeColor = System.Drawing.Color.Red;
                    Label_Finalize_Stat.Text      = "Deal Finalization Request Failed";
                }
            }
            else
            {
                Label_Finalize_Stat.Visible   = true;
                Label_Finalize_Stat.ForeColor = System.Drawing.Color.Red;
                Label_Finalize_Stat.Text      = "Vendor needs to finalize the deal with final quotes";
            }
        }