| | |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"]; |
| | | |
| | | /// <summary> |
| | | /// 新增单据-保存按钮 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Cj_StationOutBill/AddBill")] |
| | | |
| | | /// <summary> |
| | | /// 新增单据-保存按钮 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Cj_StationOutBill/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | |
| | | string HRemark = HttpContext.Current.Request.Params["HRemark"]; //备注 |
| | | string HUserName = HttpContext.Current.Request.Params["HUserName"]; //创建人 |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string path = HttpContext.Current.Server.MapPath("~/Files/" + HBillNo); |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/" + HBillNo); |
| | | //string path = @"C:\\files\\" + HBillNo; |
| | | //string path = HttpContext.Current.Server.MapPath(filePath + HBillNo); |
| | | //filePath |
| | | dynamic dyResult = UpLoadFile(files, path, HBillNo, HRemark, HUserName); |
| | | if (dyResult != null && dyResult.result == 1) |
| | | { |
| | |
| | | { |
| | | File.Delete(fileurl); //删除指定文件 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/Files/"+ HBillNo+"/"+ filename; |
| | | string StrPath = "/files/"+ HBillNo+"/"+ filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | { |
| | | Directory.CreateDirectory(fileSavePath); //添加文件夹 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/Files/" + HBillNo + "/" + filename; |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | [HttpGet] |
| | | public object Filelist(string HBillNo) |
| | | { |
| | | var url = fileip + "/Files/" + HBillNo+"/"; |
| | | var url = fileip + "/files/" + HBillNo+"/"; |
| | | //@"C:\\files\\" |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url from MES_AccessoriesList where HSourceBillNo=" + HBillNo, "MES_AccessoriesList"); |
| | | ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url from MES_AccessoriesList where HSourceBillNo='" + HBillNo+"'", "MES_AccessoriesList"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |