|
|
@@ -17,7 +17,7 @@ namespace MySystem.Service.Bs
|
|
|
string _conn = "";
|
|
|
public SystemSetService()
|
|
|
{
|
|
|
- _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
+ _conn = ConfigurationManager.AppSettings["BsSqlConnStr"].ToString();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -36,11 +36,11 @@ namespace MySystem.Service.Bs
|
|
|
fields.Add("CreateDate"); //添加时间
|
|
|
fields.Add("Status"); //状态
|
|
|
fields.Add("WebUrl"); //网站地址
|
|
|
-fields.Add("WebName"); //网站名称
|
|
|
-fields.Add("UploadMaxSize"); //允许最大上传
|
|
|
-fields.Add("UploadAutoZoomWidth"); //自动缩略图宽
|
|
|
-fields.Add("UploadAutoZoomHeight"); //自动缩略图高
|
|
|
-fields.Add("UploadAutoWater"); //自动水印
|
|
|
+ fields.Add("WebName"); //网站名称
|
|
|
+ fields.Add("UploadMaxSize"); //允许最大上传
|
|
|
+ fields.Add("UploadAutoZoomWidth"); //自动缩略图宽
|
|
|
+ fields.Add("UploadAutoZoomHeight"); //自动缩略图高
|
|
|
+ fields.Add("UploadAutoWater"); //自动水印
|
|
|
|
|
|
Dictionary<string, object> obj = new DbService(AppConfig.Base.dbTables, _conn).IndexData("SystemSet", relationData, orderBy, page, limit, condition, fields);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
@@ -54,11 +54,11 @@ fields.Add("UploadAutoWater"); //自动水印
|
|
|
fields.Add("CreateDate"); //添加时间
|
|
|
fields.Add("Status"); //状态
|
|
|
fields.Add("WebUrl"); //网站地址
|
|
|
-fields.Add("WebName"); //网站名称
|
|
|
-fields.Add("UploadMaxSize"); //允许最大上传
|
|
|
-fields.Add("UploadAutoZoomWidth"); //自动缩略图宽
|
|
|
-fields.Add("UploadAutoZoomHeight"); //自动缩略图高
|
|
|
-fields.Add("UploadAutoWater"); //自动水印
|
|
|
+ fields.Add("WebName"); //网站名称
|
|
|
+ fields.Add("UploadMaxSize"); //允许最大上传
|
|
|
+ fields.Add("UploadAutoZoomWidth"); //自动缩略图宽
|
|
|
+ fields.Add("UploadAutoZoomHeight"); //自动缩略图高
|
|
|
+ fields.Add("UploadAutoWater"); //自动水印
|
|
|
|
|
|
Dictionary<string, object> obj = new DbService(AppConfig.Base.dbTables, _conn).IndexData("SystemSet", relationData, orderBy, page, limit, condition, fields);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
@@ -87,7 +87,7 @@ fields.Add("UploadAutoWater"); //自动水印
|
|
|
{
|
|
|
int result = 0;
|
|
|
DataTable dt = CustomerSqlConn.dtable("select count(Id) from SystemSet where 1=1" + condition, _conn);
|
|
|
- if(dt.Rows.Count > 0)
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
result = int.Parse(function.CheckInt(dt.Rows[0][0].ToString()));
|
|
|
}
|
|
|
@@ -114,32 +114,32 @@ fields.Add("UploadAutoWater"); //自动水印
|
|
|
/// <returns></returns>
|
|
|
public AppResultJson Add(Dictionary<string, object> fields, bool check = true)
|
|
|
{
|
|
|
- if(check)
|
|
|
+ if (check)
|
|
|
{
|
|
|
if (!function.IsInt(fields["UploadMaxSize"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写正确的允许最大上传" };
|
|
|
-}
|
|
|
-if (string.IsNullOrEmpty(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图宽" };
|
|
|
-}
|
|
|
-if (!function.IsInt(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图宽" };
|
|
|
-}
|
|
|
-if (string.IsNullOrEmpty(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图高" };
|
|
|
-}
|
|
|
-if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图高" };
|
|
|
-}
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写正确的允许最大上传" };
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图宽" };
|
|
|
+ }
|
|
|
+ if (!function.IsInt(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图宽" };
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图高" };
|
|
|
+ }
|
|
|
+ if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图高" };
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
int Id = new DbService(AppConfig.Base.dbTables, _conn).Add("SystemSet", fields, 0);
|
|
|
- return new AppResultJson(){ Status = "1", Data = Id };
|
|
|
+ return new AppResultJson() { Status = "1", Data = Id };
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -149,32 +149,32 @@ if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
/// <param name="Id">主键Id</param>
|
|
|
public AppResultJson Edit(Dictionary<string, object> fields, int Id, bool check = true)
|
|
|
{
|
|
|
- if(check)
|
|
|
+ if (check)
|
|
|
{
|
|
|
if (!function.IsInt(fields["UploadMaxSize"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写正确的允许最大上传" };
|
|
|
-}
|
|
|
-if (string.IsNullOrEmpty(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图宽" };
|
|
|
-}
|
|
|
-if (!function.IsInt(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图宽" };
|
|
|
-}
|
|
|
-if (string.IsNullOrEmpty(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图高" };
|
|
|
-}
|
|
|
-if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
-{
|
|
|
- return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图高" };
|
|
|
-}
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写正确的允许最大上传" };
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图宽" };
|
|
|
+ }
|
|
|
+ if (!function.IsInt(fields["UploadAutoZoomWidth"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图宽" };
|
|
|
+ }
|
|
|
+ if (string.IsNullOrEmpty(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写自动缩略图高" };
|
|
|
+ }
|
|
|
+ if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
+ {
|
|
|
+ return new AppResultJson() { Status = "-1", Info = "请填写正确的自动缩略图高" };
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
new DbService(AppConfig.Base.dbTables, _conn).Edit("SystemSet", fields, Id);
|
|
|
- return new AppResultJson(){ Status = "1", Data = Id };
|
|
|
+ return new AppResultJson() { Status = "1", Data = Id };
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -215,15 +215,15 @@ if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
{
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
JsonData list = JsonMapper.ToObject(ExcelData);
|
|
|
- for (int i = 1; i < list.Count;i++ )
|
|
|
+ for (int i = 1; i < list.Count; i++)
|
|
|
{
|
|
|
JsonData dr = list[i];
|
|
|
-
|
|
|
+
|
|
|
db.SystemSet.Add(new SystemSet()
|
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
|
UpdateDate = DateTime.Now,
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
@@ -238,7 +238,7 @@ if (!function.IsInt(fields["UploadAutoZoomHeight"].ToString()))
|
|
|
/// <returns></returns>
|
|
|
// public void ExportExcel(List<RelationData> relationData, string condition)
|
|
|
// {
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
}
|
|
|
}
|