public DataSet ExpressInterest_sendmultimails(ExpressInterestInsert ExpML, string spName)
        {
            List <Smtpemailsending> li         = new List <Smtpemailsending>();
            SqlConnection           connection = new SqlConnection();
            DataSet dtFromTo = new DataSet();

            connection = SQLHelper.GetSQLConnection();
            connection.Open();

            try
            {
                SqlParameter[] parm = new SqlParameter[5];
                parm[0]           = new SqlParameter("@cust_Id", SqlDbType.Int);
                parm[0].Value     = ExpML.FromCustID;
                parm[1]           = new SqlParameter("@empid", SqlDbType.BigInt);
                parm[1].Value     = ExpML.EmpID;
                parm[2]           = new SqlParameter("@TblDetails", SqlDbType.Structured);
                parm[2].Value     = ExpML.dtExpInt;
                parm[3]           = new SqlParameter("@emailaddress", SqlDbType.VarChar);
                parm[3].Value     = ExpML.emailaddress;
                parm[4]           = new SqlParameter("@Status", SqlDbType.Int);
                parm[4].Direction = ParameterDirection.Output;

                //  reader = SQLHelper.ExecuteReader(connection, CommandType.StoredProcedure, spName, parm);
                dtFromTo = SQLHelper.ExecuteDataset(connection, CommandType.StoredProcedure, spName, parm);
                Commonclass.ExpressInterestSMS(ExpML.dtExpInt, " ");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }

            return(dtFromTo);
        }
        public Tuple <List <Smtpemailsending>, int?> ExpressInterest(ExpressInterestInsert ExpML, string spName)
        {
            int?status = null;

            SqlDataReader           reader;
            List <Smtpemailsending> li         = new List <Smtpemailsending>();
            SqlConnection           connection = new SqlConnection();

            connection = SQLHelper.GetSQLConnection();
            connection.Open();

            try
            {
                SqlParameter[] parm = new SqlParameter[5];
                parm[0]           = new SqlParameter("@cust_Id", SqlDbType.Int);
                parm[0].Value     = ExpML.FromCustID;
                parm[1]           = new SqlParameter("@empid", SqlDbType.BigInt);
                parm[1].Value     = ExpML.EmpID;
                parm[2]           = new SqlParameter("@TblDetails", SqlDbType.Structured);
                parm[2].Value     = ExpML.dtExpInt;
                parm[3]           = new SqlParameter("@emailaddress", SqlDbType.VarChar);
                parm[3].Value     = ExpML.emailaddress;
                parm[4]           = new SqlParameter("@Status", SqlDbType.Int);
                parm[4].Direction = ParameterDirection.Output;

                reader = SQLHelper.ExecuteReader(connection, CommandType.StoredProcedure, spName, parm);

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        li.Clear();
                        Smtpemailsending smtp = new Smtpemailsending();
                        {
                            smtp.profile_name = (reader["profile_name"]) != DBNull.Value ? reader.GetString(reader.GetOrdinal("profile_name")) : string.Empty;
                            smtp.recipients   = (reader["recipients"]) != DBNull.Value ? reader.GetString(reader.GetOrdinal("recipients")) : string.Empty;
                            smtp.body         = (reader["body"]) != DBNull.Value ? reader.GetString(reader.GetOrdinal("body")) : string.Empty;
                            smtp.subject      = (reader["subject"]) != DBNull.Value ? reader.GetString(reader.GetOrdinal("subject")) : string.Empty;
                            smtp.body_format  = (reader["body_format"]) != DBNull.Value ? reader.GetString(reader.GetOrdinal("body_format")) : string.Empty;
                            smtp.Status       = (reader["Status"]) != DBNull.Value ? reader.GetInt32(reader.GetOrdinal("Status")) : status;
                        }
                        li.Add(smtp);
                        Commonclass.SendMailSmtpMethod(li, "exp");
                    }
                }

                Commonclass.ExpressInterestSMS(ExpML.dtExpInt, " ");

                reader.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                connection.Close();
            }

            return(new Tuple <List <Smtpemailsending>, int?>(li, status));
        }