Example #1
0
        public ActionResult Add(RegisterAddDTO dto)
        {
            UserLoginDTO lng = Session["UserLoginInfo"] as UserLoginDTO;

            dto.UserInfo      = lng.UserInfo();
            dto.AttachmentIDs = new List <RegisterAttachmentDTO>();
            HttpContext.Request.Files.AllKeys.Select(key => HttpContext.Request.Files[key]).Where(p => !string.IsNullOrEmpty(p.FileName)).ToList().ForEach(p =>
            {
                var att = new RegisterAttachmentDTO
                {
                    AttachmentID   = Guid.NewGuid(),
                    AttachmentName = p.FileName,
                    AttachmentSize = p.ContentLength,
                };
                p.SaveAs(Const.RealBccePath(att.AttachmentID.ToString()));
                dto.AttachmentIDs.Add(att);
            });
            var pt = ProductManagementProvider.GetProductType(dto.ProductTypeID.Value);
            var pr = ProductManagementProvider.GetOneProductLine(dto.ProductLineID.Value);

            dto.ProductLineName = pr.Object.ProductLineName;
            dto.ProductTypeName = pt.Object.ProductTypeName;
            var result = _RegisterService.Add(dto);

            return(new JsonResult(result));
        }
Example #2
0
 public DocumentResultDTO Add(RegisterAddDTO model)
 {
     return(_RegisterService.Add(model));
 }