Exemplo n.º 1
0
    private string GetTreasuryNameByCode(string code)
    {
        string            result            = string.Empty;
        SmTreasuryService smTreasuryService = new SmTreasuryService();
        SmTreasury        byCode            = smTreasuryService.GetByCode(code);

        if (byCode != null)
        {
            result = byCode.tname;
        }
        return(result);
    }
Exemplo n.º 2
0
        public IList <Treasury> GetTreasury()
        {
            List <Treasury>   list     = new List <Treasury>();
            List <SmTreasury> all      = new SmTreasuryService().ToList <SmTreasury>();
            SmTreasury        treasury = (from t in all
                                          where t.tcode == "0"
                                          select t).FirstOrDefault <SmTreasury>();
            Treasury trea = new Treasury {
                Id    = treasury.tid,
                Code  = treasury.tcode,
                Text  = treasury.tname,
                State = "open"
            };

            if (treasury.tflag == "1")
            {
                trea.Text = trea.Text + "(总库)";
            }
            this.AddChildren(trea, all);
            list.Add(trea);
            return(list);
        }