Example #1
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";
            }
        }
Example #2
0
        /// <summary>
        /// if create potential is true then it will create the potential as well
        /// </summary>
        /// <param name="contextId"></param>
        /// <param name="newrfqId"></param>
        /// <returns></returns>
        protected void createLead(String contextId, String newrfqId, bool createPotn)
        {
            BackEndObjects.RFQDetails  rfqObjForLead = BackEndObjects.RFQDetails.getRFQDetailsbyIdDB(contextId);
            BackEndObjects.RFQResponse rfqRespObj    = BackEndObjects.RFQResponse.
                                                       getRFQResponseforRFQIdandResponseEntityIdDB(rfqObjForLead.getRFQId(),
                                                                                                   Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            BackEndObjects.RFQShortlisted potObj = new RFQShortlisted();
            if (createPotn)
            {
                potObj = RFQShortlisted.
                         getRFQShortlistedbyRespEntandRFQId(rfqRespObj.getRespEntityId(), rfqRespObj.getRFQId());
            }

            Dictionary <String, RFQResponseQuotes> leadRespDict = BackEndObjects.RFQResponseQuotes.getAllResponseQuotesforRFQandResponseEntityDB(rfqObjForLead.getRFQId(),
                                                                                                                                                 Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            ArrayList rfqSpecListForLead = BackEndObjects.RFQProductServiceDetails.getAllProductServiceDetailsbyRFQIdDB(rfqObjForLead.getRFQId());
            ArrayList rfqQntyListForLead = BackEndObjects.RFQProdServQnty.getRFQProductServiceQuantityforRFIdDB(rfqObjForLead.getRFQId());

            rfqObjForLead.setRFQName(TextBox_Name.Text);
            rfqObjForLead.setSubmitDate(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            rfqObjForLead.setRFQId(newrfqId);
            rfqObjForLead.setReqId("");//Remove tagged requirements
            rfqObjForLead.setNDADocPath("");

            for (int i = 0; i < rfqSpecListForLead.Count; i++)
            {
                BackEndObjects.RFQProductServiceDetails rfqSpecObj = (BackEndObjects.RFQProductServiceDetails)rfqSpecListForLead[i];
                rfqSpecObj.setRFQId(rfqObjForLead.getRFQId());
                rfqSpecObj.setImgPath("");
            }
            rfqObjForLead.setRFQProdServList(rfqSpecListForLead);
            for (int i = 0; i < rfqQntyListForLead.Count; i++)
            {
                BackEndObjects.RFQProdServQnty rfqQntyObj = (BackEndObjects.RFQProdServQnty)rfqQntyListForLead[i];
                rfqQntyObj.setRFQId(rfqObjForLead.getRFQId());
            }
            rfqObjForLead.setRFQProdServQntyList(rfqQntyListForLead);

            rfqRespObj.setRespDate(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            rfqRespObj.setNdaPath("");
            rfqRespObj.setRFQId(rfqObjForLead.getRFQId());

            ArrayList rfqRespQuoteList = new ArrayList();

            foreach (KeyValuePair <String, RFQResponseQuotes> kvp in leadRespDict)
            {
                BackEndObjects.RFQResponseQuotes respQuoteObj = kvp.Value;
                respQuoteObj.setRFQId(rfqObjForLead.getRFQId());
                rfqRespQuoteList.Add(respQuoteObj);
            }
            rfqRespObj.setResponseQuoteList(rfqRespQuoteList);

            if (createPotn)
            {
                potObj.setRFQId(rfqObjForLead.getRFQId());
                potObj.setPotentialId(new Id().getNewId(BackEndObjects.Id.ID_TYPE_POTENTIAL_ID_STRING));
                potObj.setCreatedDate(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                potObj.setConfMatPath("");
            }

            try
            {
                ActionLibrary.SalesActions._createLeads cL = new ActionLibrary.SalesActions._createLeads();

                LeadRecord leadObj = new LeadRecord();
                leadObj.setRFQProdServList(rfqObjForLead.getRFQProdServList());
                leadObj.setRFQId(rfqObjForLead.getRFQId());
                leadObj.setActiveStat(rfqObjForLead.getActiveStat());
                leadObj.setApprovalStat(rfqObjForLead.getApprovalStat());
                leadObj.setCreatedEntity(rfqObjForLead.getCreatedEntity());
                leadObj.setCreatedUsr(rfqObjForLead.getCreatedUsr());
                leadObj.setCreateMode(rfqObjForLead.getCreateMode());
                leadObj.setDueDate(rfqObjForLead.getDueDate());
                leadObj.setEntityId(rfqObjForLead.getEntityId());

                leadObj.setLocalityId(rfqObjForLead.getLocalityId());

                leadObj.setReqId(rfqObjForLead.getReqId());
                leadObj.setRFQName(rfqObjForLead.getRFQName());
                leadObj.setRFQProdServQntyList(rfqObjForLead.getRFQProdServQntyList());
                leadObj.setSubmitDate(rfqObjForLead.getSubmitDate());
                leadObj.setTermsandConds(rfqObjForLead.getTermsandConds());
                leadObj.setCurrency(rfqObjForLead.getCurrency());

                leadObj.setLeadResp(rfqRespObj);

                cL.createNewLead(leadObj, Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(), User.Identity.Name);
                if (createPotn)
                {
                    RFQShortlisted.insertRFQShorListedEntryDB(potObj);
                }

                Label_Clone_Stat.Visible   = true;
                Label_Clone_Stat.ForeColor = System.Drawing.Color.Green;
                Label_Clone_Stat.Text      = "Cloning Successful. But no existing image or document will be copied.";
            }
            catch (Exception ex)
            {
                Label_Clone_Stat.Visible   = true;
                Label_Clone_Stat.ForeColor = System.Drawing.Color.Red;
                Label_Clone_Stat.Text      = "Cloning Failed";
            }
        }