public void SendMailToSupplier(int Quotation_ID, int RFQType, Page currentpg) { thispage = currentpg; string ServerIPAdd = ConfigurationManager.AppSettings["WebQuotSite"].ToString(); DataSet dsSendMailInfo = BLL_PURC_CTP.Get_Ctp_Supplier_Mail(Quotation_ID); switch (RFQType) { // Excel Based RFQ case 1: string strPath = Server.MapPath(".") + "\\SendRFQ\\"; string FilePath = Server.MapPath("~") + "\\Purchase\\ExcelFile\\"; FileName = dsSendMailInfo.Tables[0].Rows[0]["QTN_Contract_Code"].ToString() + "_" + dsSendMailInfo.Tables[0].Rows[0]["First_Name"].ToString().Replace(" ", "_").Replace(".", "_") + DateTime.Now.ToString("yyMMdd") + "_" + dsSendMailInfo.Tables[0].Rows[0]["PORT_NAME"].ToString() + ".xls"; DataSet dsRFQ = BLL_PURC_CTP.Get_Ctp_RFQ_Items(Quotation_ID); WriteExcell(dsRFQ, FileName, strPath, FilePath); SendEmailToSupplier(dsSendMailInfo, dsSendMailInfo.Tables[0].Rows[0]["supplier_code"].ToString(), ServerIPAdd, FileName, true, RFQType.ToString(), true); break; // Web Based RFQ case 2: SendEmailToSupplier(dsSendMailInfo, dsSendMailInfo.Tables[0].Rows[0]["supplier_code"].ToString(), ServerIPAdd, "", true, RFQType.ToString(), true); break; } }
protected void btnReworkToSupplier_Click(object sender, EventArgs e) { int sts = BLL_PURC_CTP.Update_Ctp_ReworkToSupplier(Convert.ToInt32(Session["USERID"].ToString()), Convert.ToInt32(Request.QueryString["Quotation_ID"])); if (sts > 0) { //BindFieldsAfterSave(); string ServerIPAdd = ConfigurationManager.AppSettings["WebQuotSite"].ToString(); DataSet dsSendMailInfo = BLL_PURC_CTP.Get_Ctp_Supplier_Mail(Convert.ToInt32(Request.QueryString["Quotation_ID"])); CTP_RFQ_Mail objmail = new CTP_RFQ_Mail(this); objmail.SendEmailToSupplier(dsSendMailInfo, dsSendMailInfo.Tables[0].Rows[0]["supplier_code"].ToString(), ServerIPAdd, "", true, "3", true); String msg = String.Format("window.open('','_self','');window.close();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true); } }