/// <summary>
        /// 创建产品
        /// </summary>
        /// <param name="typeId">产品大类</param>
        /// <param name="subId">产品子类</param>
        /// <param name="cnt">创建的产品数量</param>
        /// <returns>创建成功后的产品树JSON结构</returns>
        /// <remarks>2017/1/19  liujf   create</remarks>
        public string CreateProduct(string item_counts, string BusId, string SBusId, string typeId, string subId, string mmId, string cnt)
        {
            ExceResult rs = new ExceResult();

            int count;

            if (int.TryParse(cnt, out count))
            {
                if (count < 1)
                {
                    rs.success = false;
                    rs.msg     = "产品数量不正确";
                    return(JsonConvert.SerializeObject(rs));
                }

                string comanyId = Session["CurrentCompanyGuid"].ToString();
                string Currency = Session["Currency"].ToString();
                bool   bom      = ProductSvc.CreateProduct(Currency, comanyId, item_counts, BusId, SBusId, typeId, subId, mmId, count);

                if (bom)
                {
                    rs.success = true;
                    rs.msg     = "产品创建成功";
                }
                else
                {
                    rs.success = false;
                    rs.msg     = "该产品创建失败";
                }
            }
            else
            {
                rs.success = false;
                rs.msg     = "产品数量不正确";
            }
            return(JsonConvert.SerializeObject(rs));
        }
        public IActionResult CreateProduct(ProductReq req)
        {
            var result = _svc.CreateProduct(req);

            return(Ok(result));
        }
示例#3
0
        public IActionResult CreateProduct([FromBody] ProductReq req)
        {
            var res = _svc.CreateProduct(req);

            return(Ok(res));
        }