public string GetClass(object companyId) { if (new Guid(companyId.ToString()) == Guid.Empty) { return(string.Empty); } CostCussentInfo info = _costCussentDao.GetCompanyCussent(new Guid(companyId.ToString())); string className = info.CompanyId != Guid.Empty ? info.CompanyName : _costDao.GetCompanyClass(new Guid(companyId.ToString())).CompanyClassName; if (string.IsNullOrEmpty(className)) { className = string.Empty; } return(className); }
/// <summary> /// 费用分类 /// </summary> /// <param name="companyClassId">费用分类Id</param> /// <param name="companyId">具体类别Id</param> /// <returns></returns> /// zal 2015-11-13 public string GetCompanyName(Guid companyClassId, Guid companyId) { string companyName = string.Empty; if (!companyClassId.Equals(Guid.Empty)) { var costCompanyClassInfo = _costDao.GetCompanyClass(companyClassId); if (costCompanyClassInfo != null) { companyName = costCompanyClassInfo.CompanyClassName; if (!companyId.Equals(Guid.Empty)) { var costCussentInfo = _costCussent.GetCompanyCussent(companyId); if (costCussentInfo != null) { companyName += "-" + costCussentInfo.CompanyName; } } } } return(companyName); }