示例#1
0
        public ActionResult Update(RegisterUpdateDTO 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.RealRegisterPath(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.Update(dto);

            return(new JsonResult(result));
        }
示例#2
0
        /// <summary>
        /// 得到经销商信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetDistributorList(DistributorSearchDTO dto)
        {
            ResultData <List <DistributorResultDTO> > result = null;

            dto.page = 1;
            dto.rows = 10000000;
            result   = ProductManagementProvider.GetDistributorList(dto);

            return(Json(result.Object, JsonRequestBehavior.AllowGet));
        }