Esempio n. 1
0
        public ActionResult Comment(string id)
        {
            IChuLiBLL m_BLL = new ChuLiBLL();
            var       item  = m_BLL.GetById(id);

            return(View(item));
        }
Esempio n. 2
0
        /// <summary>
        /// 首次编辑
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>

        public ActionResult Edit(string id)
        {
            IChuLiBLL m_BLL = new ChuLiBLL();
            ChuLi     item  = m_BLL.GetById(id);

            return(View(item));
        }
Esempio n. 3
0
        public ActionResult List()
        {
            Account   account = GetCurrentAccount();
            string    biaoshi = account.BiaoShi;
            IChuLiBLL m_BLL   = new ChuLiBLL();
            var       list    = m_BLL.GetList(biaoshi);

            return(View(list));
        }
Esempio n. 4
0
        public ActionResult Edit(string id, ShenQing entity)
        {
            entity.Id = id;
            SuggestionRes response = new SuggestionRes();

            #region 各种校验

            if (string.IsNullOrWhiteSpace(entity.BaoXiuRen))
            {
                response.errorCode = 2;
                return(Json(response));
            }
            if (string.IsNullOrWhiteSpace(entity.LianXiDianHua))
            {
                response.errorCode = 3;
                return(Json(response));
            }
            if (string.IsNullOrWhiteSpace(entity.MiaoShu))
            {
                response.errorCode = 4;
                return(Json(response));
            }
            #endregion

            Account account = GetCurrentAccount();
            entity.HuiYuanId    = account.Id;
            entity.BiaoShi      = account.BiaoShi;
            entity.CreatePerson = account.PersonName;

            string    returnValue = string.Empty;
            IChuLiBLL m_BLL       = new ChuLiBLL();
            if (!m_BLL.EditAndCopy(ref validationErrors, entity))
            {
                if (validationErrors != null && validationErrors.Count > 0)
                {
                    validationErrors.All(a =>
                    {
                        returnValue += a.ErrorMessage;
                        return(true);
                    });
                }
                response.errorCode = 99;
                response.content   = returnValue;
                return(Json(response));
            }

            response.errorCode = 0;
            return(Json(response));
        }
Esempio n. 5
0
        public ActionResult Comment(string id, ChuLi entity)
        {
            SuggestionRes response = new SuggestionRes();

            #region 各种校验
            if (!Validator.IsNumber(entity.DaFen.GetString()))
            {
                response.errorCode = 2;
                return(Json(response));
            }
            if (string.IsNullOrWhiteSpace(entity.PingLun))
            {
                response.errorCode = 4;
                return(Json(response));
            }

            #endregion

            string currentPerson = GetCurrentPerson();

            string    returnValue = string.Empty;
            IChuLiBLL m_BLL       = new ChuLiBLL();
            if (!m_BLL.Comment(ref validationErrors, entity))
            {
                if (validationErrors != null && validationErrors.Count > 0)
                {
                    validationErrors.All(a =>
                    {
                        returnValue += a.ErrorMessage;
                        return(true);
                    });
                }
                response.errorCode = 1;
                response.content   = returnValue;
                return(Json(response));
            }

            response.errorCode = 0;
            return(Json(response));
        }
Esempio n. 6
0
 public ChuLiController(ChuLiBLL bll)
 {
     m_BLL = bll;
 }