Ejemplo n.º 1
0
        /// <summary>
        /// 查询公司信息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetSingle()
        {
            DataResult <CompanyEntity> result = null;
            string CompanyNum = WebUtil.GetFormValue <string>("CompanyNum", string.Empty);

            if (CompanyNum.IsEmpty())
            {
                result = new DataResult <CompanyEntity>()
                {
                    Code = (int)EResponseCode.Exception, Message = "公司编号为空"
                };
                return(Content(JsonHelper.SerializeObject(result)));
            }

            CompanyProvider provider = new CompanyProvider();
            CompanyEntity   entity   = provider.GetSingle(CompanyNum);

            result = new DataResult <CompanyEntity>()
            {
                Code = (int)EResponseCode.Success, Message = "响应成功", Result = entity
            };
            return(Content(JsonHelper.SerializeObject(result)));
        }