Exemplo n.º 1
0
 public static DataTable GetAllCustomer(string CompanyLink)
 {
     MySqlParameter[] parameters =
     {
         new MySqlParameter("CompanyLink", CompanyLink)
     };
     return(DatabaseConnectionSqlServer.GetDataTable("GetAllCustomer", parameters));
 }
Exemplo n.º 2
0
 public static DataTable GetAllProjectFilter(string filter, string CompanyLink)
 {
     MySqlParameter[] parameters =
     {
         new MySqlParameter("filter",      filter),
         new MySqlParameter("CompanyLink", CompanyLink),
     };
     return(DatabaseConnectionSqlServer.GetDataTable("GetAllProjectFilter", parameters));
 }
Exemplo n.º 3
0
        public static bool SendMail(string subject, string body, string MailTo, string CompanyLink)
        {
            // SEND MAIL
            bool issuccess = false;

            string emailfrom = string.Empty;
            string password  = string.Empty;

            DataTable dt = DatabaseConnectionSqlServer.GetDataTable("Select Email.* from Email where Email.IsDeactivate=0 and Email.CompanyLink='" + CompanyLink + "'");


            if (dt.Rows.Count > 0)
            {
                emailfrom = dt.Rows[0]["Email"].ToString();
                password  = dt.Rows[0]["Password"].ToString();
            }
            else
            {
                emailfrom = ConfigurationManager.AppSettings["EmailId"].ToString();
                password  = ConfigurationManager.AppSettings["Password"].ToString();
            }
            string     port       = ConfigurationManager.AppSettings["Port"].ToString();
            string     host       = ConfigurationManager.AppSettings["Host"].ToString();
            string     enablessl  = ConfigurationManager.AppSettings["EnableSSL"].ToString();
            SmtpClient SmtpServer = new SmtpClient();

            SmtpServer.Credentials = new System.Net.NetworkCredential(emailfrom, password);

            SmtpServer.Port = Convert.ToInt32(port);
            SmtpServer.Host = host;

            SmtpServer.EnableSsl = Convert.ToBoolean(enablessl);
            MailMessage mail = new MailMessage();

            //mail.IsBodyHtml = true;

            mail.From    = new MailAddress(emailfrom, emailfrom, System.Text.Encoding.UTF8);
            mail.Subject = subject;
            mail.To.Add(MailTo);
            //mail.To.Add("*****@*****.**");
            //mail.To.Add("*****@*****.**");
            mail.IsBodyHtml = true;
            mail.Body       = body;

            try
            {
                SmtpServer.Send(mail);
                issuccess = true;
            }
            catch (Exception ex)
            {
                issuccess = false;
                //File.AppendAllText(@"c:\projects\ScheduledService.txt", "\nError at :\n " + ex.Message + "\n" + DateTime.Now.ToString());
            }
            return(issuccess);
        }
Exemplo n.º 4
0
        public static DataTable GetItemByProjectNo(string ProjectNo)
        {
            // GET PROJECT DETAIL USING PROJECT NUMBER
            MySqlParameter[] parameters =
            {
                new MySqlParameter("ProjectNo", ProjectNo)
            };

            return(DatabaseConnectionSqlServer.GetDataTable("GetItemByProjectNo", parameters));
        }
Exemplo n.º 5
0
 public static DataTable GetDuplicateCustomer(string Customer, string CompanyLink)
 {
     // GET DUPLICATE CUSTOMER USING NAME
     MySqlParameter[] parameters =
     {
         new MySqlParameter("Customer",    Customer),
         new MySqlParameter("CompanyLink", CompanyLink)
     };
     return(DatabaseConnectionSqlServer.GetDataTable("GetDuplicateCustomer", parameters));
 }
Exemplo n.º 6
0
        public static DataTable GetDocNo(string DocType)
        {
            // GET DOCUMENT NUMBER
            MySqlParameter[] parameters =
            {
                new MySqlParameter("DocType", DocType)
            };
            DataTable dt = DatabaseConnectionSqlServer.GetDataTable("GetDocNo", parameters);

            return(dt);
        }
Exemplo n.º 7
0
 public static DataTable GetMenusByUserType(int PLink, string UserLink, string UserType, string IsTop)
 {
     // GET MENUS FOR LOGIN USER USING USER TYPE
     MySqlParameter[] parameters =
     {
         new MySqlParameter("ParentLink", PLink),
         new MySqlParameter("UserLink",   UserLink),
         new MySqlParameter("UserType",   UserType),
         new MySqlParameter("IsTop",      IsTop)
     };
     return(DatabaseConnectionSqlServer.GetDataTable("GetMenusByUserType", parameters));
 }