Exemplo n.º 1
0
        public ActionResult Add(Epm_Draw model)
        {
            ResultView <int> view = new ResultView <int>();

            //上传图纸
            string            fileDataJson = Request.Form["fileDataJsonFile"];                                 //获取上传图片json字符串
            List <Base_Files> fileListFile = JsonConvert.DeserializeObject <List <Base_Files> >(fileDataJson); //将文件信息json字符

            //表单校验
            //if (string.IsNullOrEmpty(model.Name))
            //{
            //    view.Flag = false;
            //    view.Message = "名称不能为空";
            //    return Json(view);
            //}
            //if (string.IsNullOrEmpty(model.VersionOrder))
            //{
            //    view.Flag = false;
            //    view.Message = "版本号不能为空";
            //    return Json(view);
            //}
            Result <int> result = new Result <int>();

            using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request)))
            {
                result = proxy.AddDraw(model, fileListFile);

                //var project = proxy.GetProject(model.ProjectId.Value).Data;
                //DateTime time = DateTime.Now;
                //if (fileListFile != null)
                //{
                //    foreach (var item in fileListFile)
                //    {
                //        if (string.IsNullOrEmpty(item.ImageType))
                //        {
                //            Bp_SendDate send = new Bp_SendDate();
                //            send.IsSend = false;
                //            send.Key = "2002040005";
                //            send.Value = "{\"FDFS_NAME\":\"" + item.Url + "\",\"FDFS_GROUP\":\"" + item.Group + "\",\"NAME\":\"" + item.Name + "\",\"WJLX\":\"" + ListExtensionMethod.GetFileType(item.Name) + "\",\"SIZE\":\"" + ListExtensionMethod.GetByteLength(item.Size) + "\",\"USER\":\"" + CurrentUser.UserCode + "\"}";
                //            send.Type = "12";
                //            send.Project = "BIM";
                //            send.KeyValue = project.ObjeId;
                //            send.UserName = CurrentUser.UserCode;
                //            send.CreateTime = time;
                //            send.OperateTime = time;
                //            send.OperateUserId = CurrentUser.UserId;
                //            send.OperateUserName = CurrentUser.UserName;
                //            send.CreateUserId = CurrentUser.UserId;
                //            send.CreateUserName = CurrentUser.UserName;
                //            proxy.AddSendDate(send);
                //        }
                //    }
                //}
            }
            return(Json(result.ToResultView()));
        }