using NFine.Domain.Entity.SystemManage; using NFine.Repository; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NFine.Application.SystemManage { public class MailApp : RepositoryFactory { public string MailServer { get; set; } /// /// 用户名 /// public string MailUserName { get; set; } /// /// 密码 /// public string MailPassword { get; set; } /// /// 名称 /// public string MailName { get; set; } /// /// 端口 /// public int Post { get; set; } public MailApp(string ItemType,string ItemDetailType) { string sql = @"select top 1 F_Define1 mailFrom,F_Define2 Password,F_Define3 MailServer ,F_Define4 Post,detail.F_ItemName Name from Sys_SRM_Items item left join Sys_SRM_ItemsDetail detail on detail.F_ItemId=item.F_Id where item.F_EnCode='" + ItemType + @"' and detail.F_ItemCode='" + ItemDetailType + @"'"; DataTable dt = Repository().FindTableBySql(sql); if (dt != null && dt.Rows.Count > 0) { MailServer = dt.Rows[0]["MailServer"].ToString(); MailUserName = dt.Rows[0]["mailFrom"].ToString(); MailPassword = dt.Rows[0]["Password"].ToString(); MailName = dt.Rows[0]["Name"].ToString(); Post = Convert.ToInt32(dt.Rows[0]["Post"].ToString()); } } } }