Exemple #1
0
        public IActionResult GetAllCertificates()
        {
            var certificate           = _service.GetAllCertificate();
            List <CertificateDto> Dto = new List <CertificateDto>();

            foreach (var item in certificate)
            {
                CertificateDto Dtos = _mapper.Map <CertificateDto>(item);
                Dto.Add(Dtos);
            }
            return(Ok(Dto));
        }
Exemple #2
0
        private void CertificateBind()
        {
            ICertificateService myCertificateServiceInstance = ClientHelper.GetServiceInstance <ICertificateService>("CertificateService");
            List <CustomerShipingCertificate> certificate    = new List <CustomerShipingCertificate>();

            try
            {
                advcertificate.Nodes.Clear();
                if (Contractnum == null)
                {
                    certificate = myCertificateServiceInstance.FindCertificateByGoodsKindAndCustomer(this.goodskind, this.Customer.customer_id, this.inoutType).ToList();
                }
                else
                {
                    List <CustomerShipingCertificate> customercertificates = myCertificateServiceInstance.GetAllCertificate().ToList().Where(d => d.contract == Contractnum && d.bill_status == (int)Aisino.MES.Model.Models.CustomerShipingCertificate.CertificateStatus.审批通过).ToList();
                    foreach (CustomerShipingCertificate customercertificate in customercertificates)
                    {
                        if (customercertificate.excepted_count > customercertificate.finished_count)
                        {
                            certificate.Add(customercertificate);
                        }
                    }
                }
                if (certificate.Count > 0)
                {
                    advcertificate.Nodes.Clear();
                    for (int i = 0; i < certificate.Count; i++)
                    {
                        Node masterContractNode = new Node();
                        masterContractNode.Tag  = certificate[i];
                        masterContractNode.Text = certificate[i].bill_id;
                        masterContractNode.Cells.Add(new Cell(certificate[i].bill_memo));
                        //masterContractNode.Cells.Add(new Cell(certificate[i].excepted_count.ToString()));
                        masterContractNode.Cells.Add(new Cell(certificate[i].finished_count.ToString()));
                        masterContractNode.Cells.Add(new Cell(certificate[i].shiping_count.ToString()));
                        advcertificate.Nodes.Add(masterContractNode);
                    }
                }
                else
                {
                    advcertificate.Nodes.Clear();
                }
            }
            catch (Aisino.MES.Service.AisinoMesServiceException ex)
            {
                AisinoMessageBox amb = new AisinoMessageBox("错误",
                                                            ex.Message,
                                                            ex.InnerException.ToString(),
                                                            "请联系系统管理员",
                                                            AisinoMessageButton.OK,
                                                            AisinoMessageIcon.Error);
                amb.ShowDialog();
            }
            catch (Exception ex)
            {
                AisinoMessageBox amb = new AisinoMessageBox("错误",
                                                            ex.Message,
                                                            ex.InnerException.ToString(),
                                                            "请联系系统管理员",
                                                            AisinoMessageButton.OK,
                                                            AisinoMessageIcon.Error);
                amb.ShowDialog();
            }
        }