コード例 #1
0
    protected void sendRFQ(object source, EventArgs e)
    {
        string strData;

        string[] Agents;
        int      i;

        try
        {
            strData = Request.Form["chkSelect"];
            Agents  = strData.Split(new char[] { ',' });

            for (i = 0; i < Agents.Length; i++)
            {
                if (txtQuoteBy.Text.Trim() != "")
                {
                    BLL_TRV_QuoteRequest RFQ = new BLL_TRV_QuoteRequest();
                    if (RFQ.AddRequestForQuote(Convert.ToInt32(RequestID),
                                               Convert.ToInt32(Agents[i]), txtQuoteBy.Text + " " + ddlDepHours1.SelectedItem.Text + ":" + ddlDepMins1.SelectedItem.Text, Convert.ToInt32(Session["USERID"].ToString())))
                    {
                        //BLL_TRV_TravelRequest TRequest = new BLL_TRV_TravelRequest();
                        //BLL_TRV_Supplier objSupplier = new BLL_TRV_Supplier();
                        //int result;
                        //string msg = "We have posted a travel request for your attention. please have a look and provide your best offer for the same. Regards, SeaChange";
                        //result = TRequest.SaveEmail("REQUEST FOR QUOTATION", objSupplier.GetSupplierEmail(Convert.ToInt32(Agents[i])),
                        //    "", msg, Convert.ToInt32(Session["USERID"]));
                        //TRequest = null;
                    }
                    RFQ = null;
                }
            }
            Response.Write("<script type='text/javascript'>alert('Request for quotation has been sent to " + i.ToString() + " AGENTS'); parent.CloseWindow('SendRFQWID');</script>");

            string js = "parent.SendRFQ_Closed();parent.hideModal('dvPopUp');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "closewindow", js, true);
        }
        catch { }
    }