コード例 #1
0
 public void fillDropDownList(string SQL, string textField, string valueField, DropDownList ddlist)
 {
     mysql                 = new MySQLDBConnector();
     reader                = mysql.ExecuteQuery(SQL);
     ddlist.DataSource     = reader;
     ddlist.DataTextField  = textField;
     ddlist.DataValueField = valueField;
     ddlist.DataBind();
     reader.Close();
     mysql.CloseDBC();
 }
コード例 #2
0
    public string getSimpleSingalField(string SQL)
    {
        string str;

        mysql  = new MySQLDBConnector();
        reader = mysql.ExecuteQuery(SQL);
        if (reader.HasRows)
        {
            reader.Read();
            str = reader.GetString(0);
        }
        else
        {
            str = "Not Assigned";
        }

        reader.Close();
        mysql.CloseDBC();

        return(str);
    }
コード例 #3
0
    public void SendMailToProjectMembers(string projectID, string subject, string body)
    {
        mysql  = new MySQLDBConnector();
        reader = mysql.ExecuteQuery("SELECT CONCAT(SEFN,' ',SELN) AS fullname , SEM FROM Staff WHERE SID IN ( SELECT SID FROM project_mailinglist WHERE PID = '" + projectID + "')");
        if (reader.HasRows)
        {
            //Send Notification Email
            MailMessage email = new MailMessage();
            MailAddress from  = new MailAddress("*****@*****.**", "Defects Detection And Tracking System (DDTS)");
            while (reader.Read())
            {
                MailAddress to = new MailAddress(reader.GetString(1), reader.GetString(0));
                email.To.Add(to);
            }
            email.From    = from;
            email.Subject = subject;
            email.Body    = body;

            SmtpClient smtp = new SmtpClient("smtp.we3tech.com");
            smtp.Send(email);
        }
        reader.Close();
        mysql.CloseDBC();
    }