Example #1
0
        public IActionResult PostKind([FromBody] GoodsKindDto model)
        {
            try
            {
                var Kind = new GoodsKind()
                {
                    GoodsBigKindId = model.GoodsBigKindId,
                    SysUserId      = model.SysUserId,
                    Name           = model.Name,
                    Index          = model.Index,
                    Img            = model.Img,
                    CreatDate      = DateTime.Now,
                    UpDate         = DateTime.Now,
                };


                _context.GoodsKinds.Add(Kind);
                _context.SaveChanges();
                return(Ok("添加成功"));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }
Example #2
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (treGoodsKind.SelectedNodes.Count > 0)
     {
         if (treGoodsKind.SelectedNodes[0].Text != "粮食品种")
         {
             SelectedGoodsKind = treGoodsKind.SelectedNodes[0].Tag as GoodsKind;
         }
     }
 }
Example #3
0
        public IEnumerable <Contract> FindContractByGoodsKindAndCustomerAndInoutType(GoodsKind goodsKind, int customerId, int inoutType)
        {
            //根据客户id,出入库类型,查找已经审批结束,状态为已经提交(未终止或结束)的合同清单
            List <int> goodsKindIds = new List <int>();

            do
            {
                goodsKindIds.Add(goodsKind.goods_kind_id);
                goodsKind = goodsKind.ParentGoodsKind;
            }while(goodsKind != null);
            return(_contractDal.Find(c => c.customer_id == customerId && goodsKindIds.Contains(c.grain_kind.Value) && c.contract_type == (int)inoutType && c.contract_status == (int)ContractStatus.审批通过 && (c.original_contract == null || c.original_contract == string.Empty)).Entities);
        }
Example #4
0
        private void BindSubGoodsKind(Node parentNode, GoodsKind parentGoodsKind)
        {
            parentNode.Nodes.Clear();

            if (parentGoodsKind.SubGoodsKind != null)
            {
                foreach (GoodsKind gk in parentGoodsKind.SubGoodsKind)
                {
                    Node goodsKindNode = new Node();
                    goodsKindNode.Tag  = gk;
                    goodsKindNode.Text = gk.goods_kind_name;
                    BindSubGoodsKind(goodsKindNode, gk);
                    parentNode.Nodes.Add(goodsKindNode);
                }
            }
        }
Example #5
0
        public IEnumerable <CustomerShipingCertificate> FindCertificateByGoodsKindAndCustomer(GoodsKind goodsKind, int customerId, int inoutType)
        {
            List <int> goodsKindIds = new List <int>();

            do
            {
                goodsKindIds.Add(goodsKind.goods_kind_id);
                goodsKind = goodsKind.ParentGoodsKind;
            } while (goodsKind != null);
            return(_certificateDal.Find(c => c.delivery_customer == customerId && goodsKindIds.Contains(c.goods_kind) && c.bill_type == (int)inoutType && c.bill_status == (int)Aisino.MES.Model.Models.CustomerShipingCertificate.CertificateStatus.审批通过).Entities);
        }