Esempio n. 1
0
        private bool SendEmailNotification(BidDetails biddetails, PurchaseOfficerInfo info)
        {
            bool success = false;

            string subject = "Trans-Asia  : Notification";

            try
            {
                if (!MailHelper.SendEmail(MailTemplate.GetDefaultSMTPServer(),
                                          MailHelper.ChangeToFriendlyName(biddetails.Creator, biddetails.CreatorEmail),
                                          MailHelper.ChangeToFriendlyName(info.Supervisor, info.EmailAdd),
                                          subject,
                                          CreateNotificationBody(),
                                          MailTemplate.GetTemplateLinkedResources(this)))
                {       // if sending failed
                    LogHelper.EventLogHelper.Log("Bid > Send Notification : Sending Failed to " + info.EmailAdd, System.Diagnostics.EventLogEntryType.Error);
                }
                else
                {       // if sending successful
                    LogHelper.EventLogHelper.Log("Bid > Send Notification : Email Sent to " + info.EmailAdd, System.Diagnostics.EventLogEntryType.Information);
                }
                success = true;
            }
            catch (Exception ex)
            {
                success = false;
                LogHelper.EventLogHelper.Log("Bid > Send Notification : " + ex.Message, System.Diagnostics.EventLogEntryType.Error);
            }

            return(success);
        }
Esempio n. 2
0
        public bool SaveBid(BidDetails bid)
        {
            try
            {
                if (bid != null)
                {
                    RedisKeyParameters redisObj = new RedisKeyParameters();
                    redisObj.UserId    = bid.UserId;
                    redisObj.ProductId = bid.ProductId;

                    string bidHashAllKeyByProduct            = RedisCacheManager.GetRedisKey("BidHashKey", redisObj);
                    string bidSortedSetAllKeyByProduct       = RedisCacheManager.GetRedisKey("AllBidsSortedSetKey", redisObj);
                    string bidSoertedSetSupplierKeyByProduct = RedisCacheManager.GetRedisKey("AllBidsSortedSetForSupplierKey", redisObj);
                    string bidAllHash = RedisCacheManager.GetRedisKey("AllBidHashKey", redisObj);

                    string BidAllBidAllProduct = RedisCacheManager.GetRedisKey("", redisObj);

                    var    trans   = RedisCacheManager.RedisCon.CreateTransaction();
                    string jsonBid = JsonConvert.SerializeObject(bid);
                    trans.HashSetAsync(bidHashAllKeyByProduct, RedisCacheManager.ConvertIntToStringWithLeftPadding(bid.BidId), jsonBid);
                    trans.SortedSetAddAsync(bidSortedSetAllKeyByProduct, RedisCacheManager.ConvertIntToStringWithLeftPadding(bid.BidId), Convert.ToDouble(bid.Amount));
                    trans.SortedSetAddAsync(bidSoertedSetSupplierKeyByProduct, RedisCacheManager.ConvertIntToStringWithLeftPadding(bid.BidId), Convert.ToDouble(bid.Amount));
                    trans.HashSetAsync(bidAllHash, RedisCacheManager.ConvertIntToStringWithLeftPadding(bid.BidId), jsonBid);
                    var exec = trans.ExecuteAsync();

                    return(RedisCacheManager.RedisCon.Wait(exec));
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Esempio n. 3
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                BidDetails          details = GetBidItemDetails(int.Parse(Session["BidRefNo"].ToString()));
                PurchaseOfficerInfo info    = GetPurchaseOfficerInfo(Convert.ToInt32(details.BuyerID.ToString()));

                if (SendEmailNotification(details, info))
                {
                    Session["Message"] = "Notification sent successfully.";
                }
                else
                {
                    // failed
                    Session["Message"] = "Failed to send notification. Please try again or contact adminitrator for assistance.";
                }
            }
            catch
            {
                // failed
                Session["Message"] = "Failed to send notification. Please try again or contact adminitrator for assistance.";
            }

            ClearVars();
            Response.Redirect("index.aspx");
        }
Esempio n. 4
0
    private void AddToBidsForOpening()
    {
        BidDetails details = GetBidItemDetails(int.Parse(Session[Constant.SESSION_BIDREFNO].ToString()));

        SqlConnection  sqlConnect  = new SqlConnection(connstring);
        SqlTransaction sqlTransact = null;

        try
        {
            sqlConnect.Open();
            sqlTransact = sqlConnect.BeginTransaction();

            SqlParameter[] sqlParams = new SqlParameter[2];
            sqlParams[0]       = new SqlParameter("@BidRefNo", SqlDbType.Int);
            sqlParams[0].Value = int.Parse(Session[Constant.SESSION_BIDREFNO].ToString());
            sqlParams[1]       = new SqlParameter("@Deadline", SqlDbType.DateTime);
            sqlParams[1].Value = details.SubmissionDeadline;

            SqlHelper.ExecuteNonQuery(connstring, CommandType.StoredProcedure, "sp_InsertBidItemForOpening", sqlParams);

            sqlTransact.Commit();
        }
        catch
        {
            sqlTransact.Rollback();
        }
        finally
        {
            sqlConnect.Close();
        }
    }
Esempio n. 5
0
    private string CreateInvitationSmsBody(BidDetails biddetails, BidParticipant participant)
    {
        //return String.Format("The Deadline for the: ", biddetails.Description, biddetails.ID, biddetails.SubmissionDeadline.ToString("MM/dd/yyyy hh:mm:ss tt"));

        DetailsView dv = Biddetails_details1.FindControl("dvEventDetails") as DetailsView;
        Label       lblPreviousDeadline = dv.FindControl("lblDeadline") as Label;

        String textMessage = "‘Submission Deadline of Bid reference Number: " + biddetails.ID + " has been changed from " + Convert.ToDateTime(lblPreviousDeadline.Text).ToString("MMMM dd, yyyy, hh:mm tt") + " to " + biddetails.SubmissionDeadline.ToString("MMMM dd, yyyy, hh:mm tt") + ".’";

        return(textMessage);
    }
Esempio n. 6
0
    private BidDetails GetBidItemDetails(int bidrefno)
    {
        DataTable  dt   = SqlHelper.ExecuteDataset(connstring, "sp_GetBidInvitationInfo", new SqlParameter[] { new SqlParameter("@BidRefNo", bidrefno) }).Tables[0];
        BidDetails item = new BidDetails();

        if (dt.Rows.Count > 0)
        {
            item = new BidDetails(dt.Rows[0]);
        }

        return(item);
    }
Esempio n. 7
0
    private string CreateNotificationBody(BidDetails biddetails, BidParticipant participant)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("<table style='width: 100%'><tr><td style='width: 1px'></td><td style='width: auto' colspan=''></td><td style='width: 1px'></td></tr>");
        sb.Append("<tr><td style='width: auto; height: 635px'></td>");
        sb.Append("<td style='width: 100%; height: auto; text-align: justify;'>");
        sb.Append("<br />");
        sb.Append("<br />");
        sb.Append(DateTime.Now.ToLongDateString());
        sb.Append("<br /><br /><br /><strong>");
        sb.Append(participant.Name);
        sb.Append("<br /></strong>");
        sb.Append("<br />");
        sb.Append("<table style='width: 745px'>");
        sb.Append("<tr>");
        sb.Append("<td style='width: 50px'>");
        sb.Append("Attention &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :</td>");
        sb.Append("<td style='width: 225px'>");
        sb.Append("<strong>");
        sb.Append(participant.Username);
        sb.Append("</strong></td></tr>");
        sb.Append("<tr>");
        sb.Append("<td style='width: 26px'>");
        sb.Append("</td>");
        sb.Append("<td style='width: 225px'>");
        sb.Append("</td></tr>");
        sb.Append("<tr>");
        sb.Append("<td style='width: 26px'>");
        sb.Append("</td>");
        sb.Append("<td style='width: 225px'>");
        sb.Append("</td></tr>");
        sb.Append("</table>");
        sb.Append("<br />");
        sb.Append("Re: ");
        sb.Append("&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ");
        sb.Append(String.Format("Changed Submission Deadline Notification : {0}", biddetails.Description));
        sb.Append("<br /><br />");
        sb.Append("Dear Sir/Madame:&nbsp;<br /><br />");
        sb.Append("We would like to inform you that the Submission Deadline &nbsp;for ");
        sb.Append(String.Format("{2} has been moved from {0:D} {0:T} to {1:D} {1:T}.<br />", _currentDeadline, _newDeadline, biddetails.Description));
        sb.Append("<br /><br /><br />");
        sb.Append("");
        sb.Append("Sincerely,");
        sb.Append("<br /><br />");
        sb.Append(Session[Constant.SESSION_USERFULLNAME].ToString());
        sb.Append("<br /><br /><br /><br /></td><td style='width: auto; height: auto'></td></tr><tr><td style='width: auto'></td><td style='width: auto'></td><td style='width: auto'></td></tr></table>");


        return(MailTemplate.IntegrateBodyIntoTemplate(sb.ToString()));
    }
        public IActionResult SaveBidDetails()
        {
            HttpRequestMessage request = new HttpRequestMessage();
            var headers = request.Headers;

            if (headers.Contains("BidDetails"))
            {
                BidDetails bidDetails = JsonConvert.DeserializeObject <BidDetails>(headers.GetValues("BidDetails").FirstOrDefault());
                string     result     = _bidBusiness.SaveBidDetails(bidDetails);
                return(Ok(result));
            }
            else
            {
                return(BadRequest());
            }
        }
Esempio n. 9
0
    private bool SetNewBidEventSubmissionDeadline(string bidrefno, string purchasingId, DateTime newDeadline, string comment)
    {
        SqlTransaction sqlTransact = null;
        SqlConnection  sqlConn     = new SqlConnection(connstring);
        bool           success     = false;

        try
        {
            sqlConn.Open();
            sqlTransact = sqlConn.BeginTransaction();

            SqlParameter[] sqlParams = new SqlParameter[4];
            sqlParams[0] = new SqlParameter("@BidRefNo", SqlDbType.Int);
            sqlParams[1] = new SqlParameter("@Deadline", SqlDbType.DateTime);
            sqlParams[2] = new SqlParameter("@Comment", SqlDbType.NVarChar);
            sqlParams[3] = new SqlParameter("@PurchasingId", SqlDbType.Int);

            sqlParams[0].Value = int.Parse(bidrefno);
            sqlParams[1].Value = newDeadline;
            sqlParams[2].Value = comment;
            sqlParams[3].Value = int.Parse(purchasingId);

            SqlHelper.ExecuteNonQuery(sqlTransact, CommandType.StoredProcedure, "sp_SetBidEventSubmissionDeadline", sqlParams);
            sqlTransact.Commit();
            success = true;

            ArrayList  list    = GetSelectedSuppliers();
            BidDetails details = GetBidItemDetails(int.Parse(Session[Constant.SESSION_BIDREFNO].ToString()));

            if (list.Count > 0)
            {
                SendEmail_ChangeDeadline(details, list);
            }
        }
        catch
        {
            sqlTransact.Rollback();
            success = false;
        }
        finally
        {
            sqlConn.Close();
        }
        return(success);
    }
Esempio n. 10
0
    protected void btnSendEmailToVendors_Click(object sender, EventArgs e)
    {
        try
        {
            ArrayList  list = GetSelectedSuppliersFromGv();
            BidDetails details = GetBidItemDetails(int.Parse(Session["BidRefNo"].ToString()));
            int        failedcount = 0, successcount = 0;

            if (list.Count > 0)
            {
                if (SendEmailInvitation(details, list, ref failedcount, ref successcount))
                {
                    if ((failedcount == 0) && (successcount > 0))
                    {
                        // success
                        Session["Message"] = (successcount == 1 ? "Invitation" : "Invitations") + " were sent successfully.";
                    }
                    else
                    {
                        // failed
                        Session["Message"] = "Failed to send " + (list.Count == 1 ? "invitation" : "invitations") + " to " + failedcount + " out of " + list.Count + (list.Count == 1 ? " recipient" : " recipients") + ". Please try again or contact adminitrator for assistance.";
                    }
                }
                else
                {
                    // failed
                    Session["Message"] = "Failed to send invitations. Please try again or contact adminitrator for assistance.";
                }
            }
            else
            {
                Session["Message"] = "No invitations sent. Please select suppliers from the given list.";
            }
        }
        catch
        {
            // failed
            Session["Message"] = "Failed to send invitations. Please try again or contact adminitrator for assistance.";
        }

        Response.Redirect("approvedbiddetails.aspx");
    }
Esempio n. 11
0
 public string SaveBidDetails(BidDetails bidDetails)
 {
     try
     {
         bidDetails.BidId = _bidBuilder.GetNewBidIdFromSQl();
         Products products = _bidBuilder.GetProductDetails(bidDetails.ProductId);
         if (bidDetails.Amount > products.BasePrice)
         {
             _bidBuilder.SaveBid(bidDetails);
             return("Successfully saved");
         }
         else
         {
             return("Amount is less than Bid Base price");
         }
     }
     catch (Exception ex) {
         return(ex.Message);
     }
 }
Esempio n. 12
0
        public BidDetails LastBidOfUser(int userId, int productId)
        {
            BidDetails         latestBid = null;
            RedisKeyParameters redisObj  = new RedisKeyParameters
            {
                UserId    = userId,
                ProductId = productId
            };
            string bidHashAllKey           = RedisCacheManager.GetRedisKey("BidHashKey", redisObj);
            string bidSortedSetSupplierKey = RedisCacheManager.GetRedisKey("AllBidsSortedSetForSupplierKey", redisObj);

            RedisValue[] redisValuesSortedSet;

            redisValuesSortedSet = RedisCacheManager.GetSortedSetRangeByRankDescending(bidSortedSetSupplierKey, 0, 0);
            if (redisValuesSortedSet != null && redisValuesSortedSet.Any())
            {
                latestBid = RedisCacheManager.GetHashItemValue <BidDetails>(bidHashAllKey, redisValuesSortedSet[0]);
            }
            return(latestBid ?? null);
        }
Esempio n. 13
0
    private string CreateInvitationBody(BidDetails biddetails, BidParticipant participant)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("<tr><td align='left'><h5>" + DateTime.Now.ToLongDateString() + "</h5></td></tr>");
        sb.Append("<tr><td align='left'><h3>INVITATION TO BID</h3></td></tr>");
        sb.Append("<tr>");
        sb.Append("<td valign='top'>");
        sb.Append("<p>");
        sb.Append("<b>TO: &nbsp;&nbsp;<u>" + participant.Name + "</u></b>");
        sb.Append("<br /><br />");
        sb.Append("Good Day!");
        sb.Append("<br /><br />");
        sb.Append("We are glad to inform you that you have been invited to participate in an online bidding event which was initiated by Trans-Asia");
        sb.Append("</p>");

        sb.Append("<table style='font-size: 12px;width:100%;'>");
        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>1.</td>");
        sb.Append("<td style='font-weight:bold;'>Bid Description</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>" + biddetails.Description + "</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>2.</td>");
        sb.Append("<td style='font-weight:bold;'>Schedule of Bid</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("Submission Deadline : " + biddetails.SubmissionDeadline + "<br />");
        sb.Append("</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>3.</td>");
        sb.Append("<td style='font-weight:bold;'>Payment Details</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("<ul>");
        sb.Append("<li>Payment Terms - indicate applicable terms.</li>");
        // Commented by Angel 10/22/2008 ::  requested by Sir Seth
        //sb.Append("<br />");
        //sb.Append("<li>Billing Details</li>");
        //sb.Append("<ul>");
        //sb.Append("<li>Contact Person: Rose Soteco T# 730 2413</li>");
        //sb.Append("<li>Contact Details: 2F GT Plaza Tower 1, Pioneer cor Madison Sts., Mandaluyong City</li>");
        //sb.Append("</ul>");
        sb.Append("</ul>");
        sb.Append("</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>4.</td>");
        sb.Append("<td style='font-weight:bold;'>Bid Price Details</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>The bid price submitted by the supplier shall be exclusive of VAT.</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>5.</td>");
        sb.Append("<td style='font-weight:bold;'>Price Validity</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("The price quoted must be valid and firm for a period of 90 days.");
        sb.Append("No change in price quoted shall be allowed after bid submission unless negotiated by Trans-Asia");
        sb.Append("</td.");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>6.</td>");
        sb.Append("<td style='font-weight:bold;'>Price Confirmation</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("Responses to the Invitation to Bid/Tender shall be sent by the vendors using the e-Sourcing Portal.");
        sb.Append("Price schedules (details) and other attachments shall be in Acrobat Format(i.e. PDF),");;
        sb.Append("or in any password-protected file (e.g. MS Word, Excel)");
        sb.Append("</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>7.</td>");
        sb.Append("<td style='font-weight:bold;'>Grounds for Invalidating Bids</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("A supplier's bid may be invalidated under any of the following circumstances:");
        sb.Append("<ul>");
        sb.Append("<li>Incomplete bid documents</li>");
        sb.Append("<li>Scanned Summary documents without bidder's signature</li>");
        sb.Append("</ul>");
        sb.Append("</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>8.</td>");
        sb.Append("<td style='font-weight:bold;'>Awarding of Bid</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("The lowest/highest bidder is not necessarily the winning bidder. Trans-Asia shall not be bound to assign any reason for not accepting any bid or accepting it in part.");
        sb.Append("Bids are still subject to further ecaluation. Trans-Asia shall award the winning supplier through a Purchase Order.");
        sb.Append("</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");

        sb.Append("<tr>");
        sb.Append("<td width='10px'></td>");
        sb.Append("<td style='font-weight:bold;width:20px;'>9.</td>");
        sb.Append("<td style='font-weight:bold;'>Penalties (depends on the items to be purchased)</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");
        sb.Append("</table>");

        sb.Append("<p>");
        sb.Append("<br /><br />");
        sb.Append("######################################################################################<br />");
        sb.Append("&nbsp;Credentials:<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;Username: "******"<br /><br />");
        sb.Append("&nbsp;Notes:<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Password is for login.<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;Username is NOT CASE SENSITIVE.<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you don't know or forgot your password, go to eBid login page and click forgot password.<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the username provided. Click Send. Your password will be sent to this email address.<br />");
        sb.Append("######################################################################################<br />");
        sb.Append("<br /><br /><br />");
        sb.Append("Sincerely Yours,");
        sb.Append("<br /><br />");
        sb.Append(biddetails.Creator);
        sb.Append("<br /><br />");
        sb.Append("</p>");
        sb.Append("</td>");
        sb.Append("</tr>");

        return(MailTemplate.IntegrateBodyIntoTemplate(sb.ToString()));
    }
Esempio n. 14
0
        public List <BidDetails> GetBidDetails()
        {
            var _object = new BidDetails();

            return(base.GetCustomFunction <BidDetails>("spAnalyticsJobBidding", _object));
        }
Esempio n. 15
0
    private bool SendEmail_ChangeDeadline(BidDetails biddetails, ArrayList recipients)
    {
        //String b_Company = ((Label)((DetailsView)Biddetails_details1.FindControl("dvEventDetails")).Rows[5].Cells[1].FindControl("lblCompany")).Text;

        bool   success      = false;
        string subject      = "Trans-Asia / Commnunications : Changed Submission Deadline Notification";
        int    failedcount  = 0;
        int    successcount = 0;

        try
        {
            #region NOTIFY VENDORS

            for (int i = 0; i < recipients.Count; i++)
            {
                BidParticipant p = (BidParticipant)recipients[i];

                if (!MailHelper.SendEmail(MailTemplate.GetDefaultSMTPServer(),
                                          MailHelper.ChangeToFriendlyName(Session[Constant.SESSION_USERFULLNAME].ToString(), Session[Constant.SESSION_USEREMAIL].ToString()),
                                          MailHelper.ChangeToFriendlyName(p.Name, p.EmailAddress),
                                          subject,
                                          CreateNotificationBody(biddetails, p),
                                          MailTemplate.GetTemplateLinkedResources(this)))
                {       // if sending failed
                    failedcount++;
                    LogHelper.EventLogHelper.Log("Bids > Send Notification : Sending Failed to " + p.EmailAddress, System.Diagnostics.EventLogEntryType.Error);
                }
                else
                {       // if sending successful
                    successcount++;
                    LogHelper.EventLogHelper.Log("Bids > Send Notification : Email Sent to " + p.EmailAddress, System.Diagnostics.EventLogEntryType.Information);

                    #region add 1 to emailsent field based on vendorID and BidRefNo

                    //SqlParameter[] sqlparams = new SqlParameter[2];
                    //sqlparams[0] = new SqlParameter("@Vendorid", SqlDbType.Int);
                    //sqlparams[0].Value = p.ID;
                    //sqlparams[1] = new SqlParameter("@BidRefNo", SqlDbType.VarChar);
                    //sqlparams[1].Value = Int32.Parse(Session["BidRefNo"].ToString());
                    //SqlHelper.ExecuteNonQuery(connstring, CommandType.StoredProcedure, "sp_BidInvitationAddEmailSent", sqlparams);
                    #endregion
                }
            }

            #region SMS SENDER
            try
            {
                for (int j = 0; j < recipients.Count; j++)
                {
                    BidParticipant BP = (BidParticipant)recipients[j];

                    if (SMSHelper.AreValidMobileNumbers(BP.MobileNo.Trim()))
                    {
                        SMSHelper.SendSMS(new SMSMessage(CreateInvitationSmsBody(biddetails, BP).Trim(), BP.MobileNo.Trim())).ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.EventLogHelper.Log("Bid Event > Send SMS Invitation : " + ex.Message, System.Diagnostics.EventLogEntryType.Error);
            }
            #endregion

            #endregion

            #region NOTIFY BUYER

            if (!MailHelper.SendEmail(MailTemplate.GetDefaultSMTPServer(),
                                      MailHelper.ChangeToFriendlyName(Session[Constant.SESSION_USERFULLNAME].ToString(), Session[Constant.SESSION_USEREMAIL].ToString()),
                                      MailHelper.ChangeToFriendlyName(biddetails.Creator, biddetails.CreatorEmail),
                                      subject,
                                      CreateNotificationBody(biddetails),
                                      MailTemplate.GetTemplateLinkedResources(this)))
            {
                failedcount++;
                LogHelper.EventLogHelper.Log("Bids > Send Notification : Sending Failed to " + Session[Constant.SESSION_USEREMAIL].ToString(), System.Diagnostics.EventLogEntryType.Error);
            }
            else
            {
                successcount++;
                LogHelper.EventLogHelper.Log("Bids > Send Notification : Email Sent to " + Session[Constant.SESSION_USEREMAIL].ToString(), System.Diagnostics.EventLogEntryType.Information);
            }

            #endregion

            success = true;
        }
        catch (Exception ex)
        {
            success = false;
            LogHelper.EventLogHelper.Log("Bid Item > Send ??? Change Notice : " + ex.Message, System.Diagnostics.EventLogEntryType.Error);
        }

        return(success);
    }
Esempio n. 16
0
    private bool SendEmailInvitation(BidDetails biddetails, ArrayList recipients, ref int failedcount, ref int successcount)
    {
        bool   success = false;
        string subject = "Trans-Asia  Incorporated/ Commnunications : Invitation to Bid";

        failedcount  = 0;
        successcount = 0;

        try
        {
            for (int i = 0; i < recipients.Count; i++)
            {
                BidParticipant p = (BidParticipant)recipients[i];

                if (!MailHelper.SendEmail(MailTemplate.GetDefaultSMTPServer(),
                                          MailHelper.ChangeToFriendlyName(biddetails.Creator, biddetails.CreatorEmail),
                                          MailHelper.ChangeToFriendlyName(p.Name, p.EmailAddress),
                                          subject,
                                          CreateInvitationBody(biddetails, p),
                                          MailTemplate.GetTemplateLinkedResources(this)))
                {       // if sending failed
                    failedcount++;
                    LogHelper.EventLogHelper.Log("Bid Event > Send Invitation : Sending Failed to " + p.EmailAddress, System.Diagnostics.EventLogEntryType.Error);
                }
                else
                {       // if sending successful
                    successcount++;
                    LogHelper.EventLogHelper.Log("Bid Event > Send Invitation : Email Sent to " + p.EmailAddress, System.Diagnostics.EventLogEntryType.Information);

                    //add 1 to emailsent field based on vendorID and BidRefNo
                    SqlParameter[] sqlparams = new SqlParameter[2];
                    sqlparams[0]       = new SqlParameter("@Vendorid", SqlDbType.Int);
                    sqlparams[0].Value = p.ID;
                    sqlparams[1]       = new SqlParameter("@BidRefNo", SqlDbType.VarChar);
                    sqlparams[1].Value = Int32.Parse(Session["BidRefNo"].ToString());
                    SqlHelper.ExecuteNonQuery(connstring, CommandType.StoredProcedure, "sp_BidInvitationAddEmailSent", sqlparams);
                }
            }

            success = true;
        }
        catch (Exception ex)
        {
            success = false;
            LogHelper.EventLogHelper.Log("Bid Event > Send Invitation : " + ex.Message, System.Diagnostics.EventLogEntryType.Error);
        }

        try
        {
            for (int j = 0; j < recipients.Count; j++)
            {
                BidParticipant p = (BidParticipant)recipients[j];

                if (SMSHelper.AreValidMobileNumbers(p.MobileNo.Trim()))
                {
                    SMSHelper.SendSMS(new SMSMessage(CreateInvitationSmsBody(biddetails, p).Trim(), p.MobileNo.Trim())).ToString();
                }
            }
        }

        catch (Exception ex)
        {
            LogHelper.EventLogHelper.Log("Bid Event > Send SMS Invitation : " + ex.Message, System.Diagnostics.EventLogEntryType.Error);
        }

        return(success);
    }
Esempio n. 17
0
    private string CreateBody(
        int status,
        string vendorname,
        string vendorAddress,
        string vendorAddress1,
        string vendorAddress2,
        string vendorAddress3,
        string vendorcontactperson,
        string vendorphone,
        string vendorfax
        )
    {
        BidDetails details = GetBidItemDetails(int.Parse(((HiddenField)dvEventDetails.Rows[5].Cells[1].FindControl("hdn_bidrefno")).Value.ToString()));
        String     b_Event = ((HiddenField)dvEventDetails.Rows[5].Cells[1].FindControl("hdn_bidevent")).Value.ToString();
        String     b_Item  = dvEventDetails.Rows[2].Cells[1].Text.ToString();

        StringBuilder sb = new StringBuilder();

        if (status == 3) //FOR RENEGOTIATION
        {
            #region CLARIFY BODY

            sb.Append("<tr><td style='width: 5%; height: 13px;'></td><td style='width: 90%; height: 13px;' colspan=''></td><td style='width: 5%; height: 13px;'></td></tr><tr><td style='width: 5%; height: 635px'></td><td style='width: 90%'><br />");
            sb.Append(DateTime.Now.ToLongDateString());
            sb.Append("<br />");
            sb.Append("<br />");
            sb.Append("<br /><strong>");
            sb.Append(vendorname);
            sb.Append("</strong><br />");
            sb.Append("<br /><br />");
            sb.Append("Attention:");
            sb.Append("<br />");
            sb.Append("Re: Request for Clarification: " + b_Item + "</p>");
            sb.Append("<br /><br />");
            sb.Append("Dear Mr/Madame,");
            sb.Append("<br /><br />");
            sb.Append("We would like to request for a clarification on your commercial tender and technical response for Bid Invitation: " + b_Item + ".<br />");
            sb.Append("Kindly refer to this item posted under <strong>Bid Tenders for Clarification</strong> on the e-Sourcing Portal for the details.");
            sb.Append("<br /><br /><br />");
            sb.Append("Very truly yours,<br /><br />");
            sb.Append(details.Sender);
            sb.Append("<br />    ");
            sb.Append("</p></td><td style='width: 5%; height: auto'></td></tr><tr><td style='width: 5%'></td><td style='width: 90%'></td><td style='width: 5%'></td></tr>");

            #endregion
        }
        else if (status == 4) //AWARDED
        {
            #region AWARDED BODY

            sb.Append("<tr><td style='width: 5%; height: 13px;'></td><td style='width: 90%; height: 13px;' colspan=''></td><td style='width: 5%; height: 13px;'></td></tr><tr><td style='width: 5%; height: 635px'></td><td style='width: 90%'><br />");
            sb.Append(DateTime.Now.ToLongDateString());
            sb.Append("<br /><br />");
            sb.Append("Managing Director");
            sb.Append("<br /><strong>");
            sb.Append(vendorname);
            sb.Append("</strong><br />");
            sb.Append("<br /><br />");
            sb.Append("Dear Mr/Madame " + vendorcontactperson + ",");
            sb.Append("<br /><br />");
            sb.Append("Re: Letter of Award - " + b_Item + "");
            sb.Append("<br /><br />");
            sb.Append("Trans-Asia / Commnunications is pleased to inform you that your bid tender has been chosen for " + b_Item + ".");
            sb.Append("Kindly get in touch with " + details.Creator + " for further details");
            sb.Append("<br /><br />");
            sb.Append("We sincerely appreciate the time and effort you have dedicated to conform with our requirements and we look forward to working with you on the fulfillment of " + b_Item + ".");
            sb.Append("<br /><br />");
            sb.Append("Very truly yours,");
            sb.Append("<br /><br />");
            sb.Append("T. Jefferson M. de Leon");
            sb.Append("<br />");
            sb.Append("<i>Head-Logistics</i>");
            sb.Append("<br /><br />");
            sb.Append("Cc:&nbsp; EC Santiago");
            sb.Append("</td><td style='width: 5%; height: auto'></td></tr><tr><td style='width: 5%'></td><td style='width: 90%'></td><td style='width: 5%'></td></tr>");

            #endregion
        }
        else if (status == 5) //NOT AWARDED
        {
            #region NOT AWARDED BODY
            sb.Append("<tr><td style='width: 1px'></td><td style='width: auto' colspan=''></td><td style='width: 1px'></td></tr>");
            sb.Append("<tr><td style='width: auto; height: 635px'></td>");
            sb.Append("<td style='width: 100%; height: auto; text-align: justify;'>");
            sb.Append("<br /><br /><br />");
            sb.Append("" + DateTime.Now.ToLongDateString() + "");
            sb.Append("<br /><br /><br /><strong>");
            sb.Append(vendorname.Trim());
            sb.Append("<br /></strong>");
            sb.Append(vendorAddress.Trim());
            sb.Append("<br />");
            sb.Append(vendorAddress1.Trim());
            sb.Append("<br />");
            sb.Append(vendorAddress2.Trim());
            sb.Append("<br />");
            sb.Append(vendorAddress3.Trim());
            sb.Append("<br /><br />");
            sb.Append("<table style='width: 100%'><tr><td style='width: 1px; height: 8px'>Attention&nbsp; :</td><td style='width: 548px; height: 8px'><strong>");
            sb.Append(vendorcontactperson.Trim());
            sb.Append("</strong></td><td style='width: 1px; height: 8px'></td></tr><tr><td style='width: 1px'></td><td style='width: 548px'>");
            sb.Append(vendorAddress.Trim());
            sb.Append("</td><td style='width: 1px'></td></tr><tr><td style='width: 1px'></td><td style='width: 548px'>");
            sb.Append(vendorAddress1.Trim());
            sb.Append("</td><td style='width: 1px'></td></tr><tr><td style='width: 1px'></td><td style='width: 548px'>");
            sb.Append(vendorAddress2.Trim());
            sb.Append("</td><td style='width: 1px'></td></tr><tr><td style='width: 1px'></td><td style='width: 548px'>");
            sb.Append(vendorAddress3.Trim());
            sb.Append("</td><td style='width: 1px'></td></tr></table>");
            sb.Append("<br /><br />");
            sb.Append("<table style='width: 100%'><tr><td style='width: 12px'>");
            sb.Append("Bid Event:");
            sb.Append("</td><td style='width: auto'>");
            sb.Append("RFP Results for " + b_Event);
            sb.Append("</td></tr><tr><td style='width: 12px'>");
            sb.Append("Bid Item:");
            sb.Append("</td><td style='width: auto'>");
            sb.Append(b_Item);
            sb.Append("</td></tr></table>");
            sb.Append("<br /><br />");
            sb.Append("Dear Sir:");
            sb.Append("<br /><br />");
            sb.Append("Thank you for your interest to help Trans-Asia  in finding a solution for ");
            sb.Append("" + b_Event + ". It certainly was a pleasure to ");
            sb.Append("have worked with your company during the RFP and the succeeding clarificatory discussions.");
            sb.Append("<br /><br />");
            sb.Append("After careful evaluation of your solution, we regret to inform you that we are unable ");
            sb.Append("to award the project to " + vendorname + ". We will, however, keep in mind your cooperation ");
            sb.Append("and commitment when we have the opportunity to implement other projects.");
            sb.Append("<br /><br />");
            sb.Append("We sincerely appreciate the time and effort you dedicated for the completion of ");
            sb.Append("this RFP and we look forward to working with you again in the future.");
            sb.Append("<br /><br /><br />");
            sb.Append("Sincerely,");
            sb.Append("<br /><br /><br /><br />");
            sb.Append("Ma. Corazon V. Martin");
            sb.Append("<br />");
            sb.Append("Head, Corporate Procurement Department");
            sb.Append("<br /><br /><br /><br /></td><td style='width: auto; height: auto'></td></tr><tr><td style='width: auto'></td><td style='width: auto'></td><td style='width: auto'></td></tr>");
            #endregion
        }
        return(MailTemplate.IntegrateBodyIntoTemplate(sb.ToString()));
    }
Esempio n. 18
0
 private string CreateInvitationSmsBody(BidDetails biddetails, BidParticipant participant)
 {
     return(String.Format("You are invited to participate in a bid event;Ref. No.:{0}, initiated by Trans-Asia . Deadline: {1}", biddetails.ID, biddetails.SubmissionDeadline.ToString("MM/dd/yyyy hh:mm:ss tt")));
 }