Пример #1
0
    private bool SendEmailInvitation(AuctionDetails auctiondetails, ArrayList recipients, ref int failedcount, ref int successcount)
    {
        bool   success = false;
        string subject = "Trans-Asia / Commnunications : Invitation to Auction";

        failedcount  = 0;
        successcount = 0;

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

                if (!MailHelper.SendEmail(MailTemplate.GetDefaultSMTPServer(),
                                          MailHelper.ChangeToFriendlyName(auctiondetails.Creator, auctiondetails.CreatorEmail),
                                          MailHelper.ChangeToFriendlyName(p.Name, p.EmailAddress),
                                          subject,
                                          CreateInvitationBody(auctiondetails, p),
                                          MailTemplate.GetTemplateLinkedResources(this)))
                {                       // if sending failed
                    failedcount++;
                    LogHelper.EventLogHelper.Log("Auction > Send Invitation : Sending Failed to " + p.EmailAddress, System.Diagnostics.EventLogEntryType.Error);
                }
                else
                {                       // if sending successful
                    successcount++;
                    LogHelper.EventLogHelper.Log("Auction > Send Invitation : Email Sent to " + p.EmailAddress, System.Diagnostics.EventLogEntryType.Information);
                    // update sent mail count
                    SqlHelper.ExecuteNonQuery(connstring, "sp_SendEmailInvitation", new SqlParameter[] { new SqlParameter("@ParticipantId", p.ID) });
                }
            }

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

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

                if (SMSHelper.AreValidMobileNumbers(p.MobileNo.Trim()))
                {
                    SMSHelper.SendSMS(new SMSMessage(CreateSMSInvitationBody(auctiondetails, p).Trim(), p.MobileNo.Trim())).ToString();
                }
            }
        }
        catch (Exception ex)
        {
            LogHelper.EventLogHelper.Log("Auction > Send SMS Invitation : " + ex.Message, System.Diagnostics.EventLogEntryType.Error);
        }

        return(success);
    }
Пример #2
0
        public static ArrayList GetAuctionParticipants(string connstring, int vAuctionRefNo)
        {
            SqlParameter[] sqlParams = new SqlParameter[1];
            sqlParams[0]       = new SqlParameter("@AuctionRefNo", SqlDbType.Int);
            sqlParams[0].Value = vAuctionRefNo;

            DataTable dtParticipants = SqlHelper.ExecuteDataset(connstring, CommandType.StoredProcedure, "sp_GetAuctionParticipants", sqlParams).Tables[0];

            ArrayList suppliersList = new ArrayList();

            foreach (DataRow dr in dtParticipants.Rows)
            {
                AuctionParticipant participant = new AuctionParticipant();
                participant.ID              = int.Parse(dr["ParticipantId"].ToString());
                participant.Username        = dr["Username"].ToString();
                participant.EncryptedTicket = dr["Ticket"].ToString();
                participant.Alias           = dr["Alias"].ToString();
                participant.Name            = dr["VendorName"].ToString();
                participant.EmailAddress    = dr["VendorEmail"].ToString();
                participant.EmailSent       = int.Parse(dr["EmailSent"].ToString());
                participant.MobileNo        = dr["MobileNo"].ToString();

                suppliersList.Add(participant);
            }
            return(suppliersList);
        }
Пример #3
0
    private ArrayList GetSelectedSuppliers()
    {
        ArrayList suppliersList = new ArrayList();

        foreach (GridViewRow gr in gvSuppliers.Rows)
        {
            // TODO: Check if checkbox is checked, if yes, add supplier in the sendlist
            CheckBox chkRow = (CheckBox)gr.FindControl("chkRow");

            if (chkRow.Checked)
            {
                int i = gr.DataItemIndex;

                AuctionParticipant participant = new AuctionParticipant();
                participant.ID              = int.Parse(gvSuppliers.DataKeys[i].Values[0].ToString());
                participant.Username        = gvSuppliers.DataKeys[i].Values[1].ToString();
                participant.EncryptedTicket = gvSuppliers.DataKeys[i].Values[2].ToString();
                participant.Alias           = gvSuppliers.DataKeys[i].Values[3].ToString();
                participant.Name            = gvSuppliers.DataKeys[i].Values[4].ToString();
                participant.EmailAddress    = gvSuppliers.DataKeys[i].Values[5].ToString();
                participant.MobileNo        = gvSuppliers.DataKeys[i].Values[6].ToString();

                suppliersList.Add(participant);
            }
        }

        return(suppliersList);
    }
Пример #4
0
        private void ReceiveMulticastMessage(string message)
        {
            try
            {
                if (message.Length > 0 && message.StartsWith("#"))
                {
                    //messages only treated by the audit server
                    if (message.StartsWith(multicast.comandoJoin))      //Join Operation. Format: #join= Participante
                    {
                        message = message.Substring(multicast.comandoJoin.Length);
                        multicast.SendUpdateMessage(ListaLances);
                        AddParticipante(JsonSerializer.Deserialize <AuctionParticipant>(message));
                    }
                    else if (message.StartsWith(multicast.comandoBuy))      //Buy Operation. Format: #buy= index, value, Participante
                    {
                        message = message.Substring(multicast.comandoBuy.Length);

                        int indexList = int.Parse(message.Substring(0, message.IndexOf(',')));                  //get content before first ',', The index of datagridview
                        message = message.Substring(message.IndexOf(',') + 1);                                  //remove content from 0 to ','

                        float audictValue = float.Parse(message.Substring(0, message.IndexOf(',')));            //get content before the second ',', The value of the transaction
                        message = message.Substring(message.IndexOf(',') + 1);                                  //remove content from 0 to ','

                        AuctionParticipant newOwner = JsonSerializer.Deserialize <AuctionParticipant>(message); //deserialize the remaining message to Participante object

                        UpdateCurrentValue(ListaLances[indexList], newOwner, audictValue);
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: " + e.Message);
            }
        }
Пример #5
0
        public string UpdateCurrentValue(AuctionItem itemLance, AuctionParticipant participante, float valorLance)   //server side
        {
            if (itemLance.IsAvailable && ListaLances.Contains(itemLance))
            {
                if (valorLance >= itemLance.CurrentValue + itemLance.MinAditionalValue)
                {
                    int listIndex = ListaLances.IndexOf(itemLance);

                    itemLance.CurrentValue = valorLance;
                    itemLance.CurrentOwner = participante.UserName;

                    ListaLances[listIndex].CurrentValue = itemLance.CurrentValue;
                    ListaLances[listIndex].CurrentOwner = itemLance.CurrentOwner;

                    UpdateDataGridAuctionItem();

                    multicast.SendUpdateMessage(ListaLances);

                    return("Lance sucedido para o item '" + itemLance.ItemName + "': \n  Lance de " + valorLance + " realizado com sucesso. \n  Novo dono do item: " + itemLance.CurrentOwner);
                }
                else
                {
                    return("Lance inválido para o item '" + itemLance.ItemName + "':\n  Valor de " + valorLance + " muito baixo. \n  Novos lances precisam de um incremento mínimo de " + itemLance.MinAditionalValue + " sobre o valor atual de " + itemLance.CurrentValue);
                }
            }
            else
            {
                return("Lance inválido para o item '" + itemLance.ItemName + "': \n  O item não está mais disponível ou não existe.");
            }
        }
Пример #6
0
    //private string CreateSMSInvitationBody(AuctionDetails auctiondetails, AuctionParticipant participant)
    //{
    //    return String.Format("You are invited to participate in an auction event;Ref. No.:{0}, initiated by Trans-Asia . Start Date: {1}", auctiondetails.ID, auctiondetails.StartDateTime.ToString("MM/dd/yyyy hh:mm:ss tt"));
    //}

    private string CreateCancelAuctionBody(AuctionDetails auctiondetails, AuctionParticipant participant)
    {
        StringBuilder sb = new StringBuilder();

        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(participant.Name);
        sb.Append("<br /></strong>");
        sb.Append("<br /><br />");
        sb.Append("<table style='width: 100%'><tr><td style='width: 12px'>");
        sb.Append("Auction Event:");
        sb.Append("</td><td style='width: auto'>");
        sb.Append(auctiondetails.Description);
        sb.Append("</td></tr></table>");
        sb.Append("<br /><br />");
        sb.Append("Dear Sir/Madame:");
        sb.Append("<br /><br />");
        sb.Append("Thank you for confirming your participation on  Trans-Asia / Commnunications Auction Invitation for ");
        sb.Append("" + auctiondetails.Description + ", that is scheduled to start on ");
        sb.Append("" + Convert.ToDateTime(auctiondetails.StartDateTime).ToLongDateString() + " " + Convert.ToDateTime(auctiondetails.StartDateTime).ToShortTimeString() + ", We regret to inform you, ");
        sb.Append("however, that the subject Auction event has been cancelled.");
        sb.Append("We will keep in mind your cooperation and commitment in helping us on this endeavor.");
        sb.Append("<br /><br />");
        sb.Append("We sincerely appreciate the time and effort you dedicated for the completion ");
        sb.Append("of your response 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(auctiondetails.Sender);
        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>");

        return(MailTemplate.IntegrateBodyIntoTemplate(sb.ToString()));
    }
Пример #7
0
 private string CreateSMSInvitationBody(AuctionDetails auctiondetails, AuctionParticipant participant)
 {
     return(String.Format("You are invited to participate in an auction event;Ref. No.:{0},initiated by Trans-Asia . Deadline: {2} Start Date: {1}", auctiondetails.ID, auctiondetails.StartDateTime.ToString("MM/dd/yyyy hh:mm tt"), auctiondetails.ConfirmationDeadline.ToString("MM/dd/yyyy")));
 }
Пример #8
0
    private string CreateInvitationBody(AuctionDetails auctiondetails, AuctionParticipant participant)
    {
        StringBuilder sb = new StringBuilder();

        sb.Append("<tr><td align='right'><h5>" + DateTime.Now.ToLongDateString() + "</h5></td></tr>");
        sb.Append("<tr><td align='center'><h3>INVITATION TO AUCTION</h3></td></tr>");
        sb.Append("<tr>");
        sb.Append("<td valign='top'>");
        sb.Append("<p>");
        sb.Append("<b>TO&nbsp&nbsp;:&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 auction event which was initiated by Trans-Asia  Incorporated.");
        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;'>Auction Description</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>" + auctiondetails.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 Auction Event</td>");
        sb.Append("</tr>");
        sb.Append("<tr>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("Confirmation Deadline : " + FormattingHelper.FormatDateToString(auctiondetails.ConfirmationDeadline) + "<br />");
        sb.Append("Start Date & Time : " + FormattingHelper.FormatDateToLongString(auctiondetails.StartDateTime) + "<br />");
        sb.Append("End Date & Time : " + FormattingHelper.FormatDateToLongString(auctiondetails.EndDateTime) + "<br />");
        sb.Append("Duration : " + auctiondetails.Duration + "<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</li>");
        sb.Append("<ul><li>Trans-Asia  shall pay supplier 10% Down Payment, Progress Billing.</li></ul>");
        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 30 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("All participants must submit the price breakdown according to the final bid price submitted during the e-BID event not later than 24 hours after the e-BIDding event has ended.");
        sb.Append("The sum of the breakdown must be equal to the supplier's final bid price submitted during the e-BIDding event.");
        sb.Append("Any attempt to submit a breakdown which totals significantlly higher or lower than the final bid price submitted during the event may be subject to sanctions from 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;'>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>Bid documents without bidder's signature</li>");
        sb.Append("<li>Late submission of hard copy of bid price breakdown</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/Sales 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>");
        sb.Append("<td width='30px' colspan='2'></td>");
        sb.Append("<td>");
        sb.Append("<ul>");
        sb.Append("<li>10K - 49.99K</li>");
        sb.Append("<li>50K - 99.99K</li>");
        sb.Append("<li>100K - 199.99K</li>");
        sb.Append("<li>200K - 299.99K</li>");
        sb.Append("<li>300K - 499.99K</li>");
        sb.Append("<li>500K - 999.99K</li>");
        sb.Append("<li>1M - 1.999M</li>");
        sb.Append("<li>2M - 19.999M</li>");
        sb.Append("<li>20M and above</li>");
        sb.Append("</ul>");
        sb.Append("</td>");
        sb.Append("</tr>");
        sb.Append("<tr><td height='10px' colspan='3'></td></tr>");
        sb.Append("</table>");

        sb.Append("<p>");
        sb.Append("To know more about this auction, click <a href='" + ConfigurationManager.AppSettings["ServerUrl"] + "web/auctions/auctiondetails.aspx?aid=" + HttpUtility.UrlEncode(EncryptionHelper.Encrypt(auctiondetails.ID.ToString())) + "' target='_blank'>here</a>. ");
        sb.Append("<br />");
        sb.Append("To confirm/decline your invitation, click <a href='" + ConfigurationManager.AppSettings["ServerUrl"] + "web/auctions/confirmauctionevent.aspx?aid=" + HttpUtility.UrlEncode(EncryptionHelper.Encrypt(auctiondetails.ID.ToString())) + "' target='_blank'>here</a>.");
        sb.Append("<br />");
        sb.Append("<a href='" + ConfigurationManager.AppSettings["ServerUrl"] + "rules.htm' target='_blank' title='Click here or copy the link'>Rules and Regulations</a> : " + ConfigurationManager.AppSettings["ServerUrl"] + "rules.htm");
        sb.Append("<br /><br />");
        sb.Append("######################################################################################<br />");
        sb.Append("&nbsp;Credentials:<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;Username: "******"<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;Ticket: " + EncryptionHelper.Decrypt(participant.EncryptedTicket) + "<br /><br />");
        sb.Append("&nbsp;Notes:<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;Ticket and password are CASE SENSITIVE.<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ticket is for confirming/declining/participating an auction.<br />");
        sb.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ticket is different for each supplier for each auction event.<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(auctiondetails.Creator);
        sb.Append("<br /><br />");
        sb.Append("</p>");
        sb.Append("</td>");
        sb.Append("</tr>");

        return(MailTemplate.IntegrateBodyIntoTemplate(sb.ToString()));
    }
Пример #9
0
 public void AddParticipante(AuctionParticipant novoParticipante)   //server side
 {
     ListaParticipantes.Add(novoParticipante);
     UpdateDataGridParticipant();
 }
Пример #10
0
        public void SendBuyMessage(int rowIndex, float valorLance, AuctionParticipant participante)
        {
            string message = comandoBuy + rowIndex + "," + valorLance + "," + JsonSerializer.Serialize(participante);

            SendMessage(message);
        }
Пример #11
0
        //talvez adicionar um comando chamado comandoMessage, onde client e servidores adicionam messagens em um datagridview que faz log de transações.

        public void SendJoinMessage(AuctionParticipant participante)
        {
            string message = comandoJoin + JsonSerializer.Serialize(participante);

            SendMessage(message);
        }