| | |
| | | { |
| | | [RoutePrefix(prefix: "api/BasicSetting")] |
| | | [ControllerGroup("基础设置","在线接口")] |
| | | [ChannelActionFilter] |
| | | public class BasicSettingController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "ImportUserExcel")] |
| | | [HttpPost] |
| | | public HttpResponseMessage ImportUserExcel(HttpPostedFileBase files) |
| | | public HttpResponseMessage ImportUserExcel(HttpPostedFileBase files,string username) |
| | | { |
| | | string savePath; |
| | | if (files == null || files.ContentLength <= 0) |
| | |
| | | } |
| | | else |
| | | { |
| | | var username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //登录用户名 |
| | | string filename = Path.GetFileName(files.FileName); |
| | | int filesize = files.ContentLength;//获取上传文件的大小单位为字节byte |
| | | string fileEx = System.IO.Path.GetExtension(filename);//获取上传文件的扩展名 |
| | |
| | | string person = obj["person"].ToString(); //联系人 |
| | | string contact = obj["contact"].ToString(); //联系方式 |
| | | string description = obj["description"].ToString(); //补充描述 |
| | | var usercode = "Admin";//HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | var usercode = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = BasicSettingBLL.AddUpdateCurrentUnit(unitid, unitcode, unitname, mtypecode, btypecode,htypecode, person, contact, description, usercode, OperType); |
| | | return TJson.toJson(mes); |