You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.8 KiB
53 lines
1.8 KiB
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<ItemsEntity>
|
|
{
|
|
public string MailServer { get; set; }
|
|
/// <summary>
|
|
/// 用户名
|
|
/// </summary>
|
|
public string MailUserName { get; set; }
|
|
/// <summary>
|
|
/// 密码
|
|
/// </summary>
|
|
public string MailPassword { get; set; }
|
|
/// <summary>
|
|
/// 名称
|
|
/// </summary>
|
|
public string MailName { get; set; }
|
|
/// <summary>
|
|
/// 端口
|
|
/// </summary>
|
|
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());
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|