物资添加照片
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
using BLL;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Web.Http;
|
||||
using static WebAPI.Controllers.HSSE.ImageRecognitionController;
|
||||
|
||||
@@ -173,5 +175,43 @@ namespace WebAPI.Controllers
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存物资文件
|
||||
[HttpPost]
|
||||
public Model.ResponeData UploadMaterialsFile(Model.Cl_file file)
|
||||
{
|
||||
Model.ResponeData responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
int count = db.Cl_file.Count();
|
||||
Model.Cl_file new_file = new Model.Cl_file();
|
||||
new_file.FID = Guid.NewGuid().ToString();
|
||||
new_file.Ffl = file.Ffl;
|
||||
new_file.Fname = file.Fname;
|
||||
new_file.Fshm = file.Fshm;
|
||||
new_file.UserTime = DateTime.Now;
|
||||
new_file.UserID = file.UserID;
|
||||
new_file.Flj = file.Flj;
|
||||
new_file.Flx = file.Flx;
|
||||
new_file.Bz = file.Bz;
|
||||
new_file.InstallationId = file.InstallationId;
|
||||
new_file.Unid = file.Unid;
|
||||
new_file.ProjectId = file.ProjectId;
|
||||
db.Cl_file.InsertOnSubmit(new_file);
|
||||
db.SubmitChanges();
|
||||
responeData.message = new_file.FID;
|
||||
}
|
||||
|
||||
}
|
||||
catch(System.Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user