/// <summary> /// 添加邮箱配置数据 /// </summary> /// <param name="model">邮箱配置Model</param> public bool SaveEmail(EmailSettings model) { int flag = (int)SettingEnum.Email; using (DataTable dt = new DataTable()) { dt.Columns.Add("S_GROUPID", typeof(string)); dt.Columns.Add("S_NAME", typeof(string)); dt.Columns.Add("S_VALUE", typeof(string)); PropertyInfo[] properties = model.GetType().GetProperties(); foreach (PropertyInfo property in properties) { DataRow dr = dt.NewRow(); dr[0] = flag; dr[1] = property.Name; dr[2] = property.GetValue(model, null); dt.Rows.Add(dr); } return(this.Save(dt, flag) > 0); } }