Esempio n. 1
0
        private void GetInfoneProjectReportPrepareList(HttpContext context, int pageIndex, int pageSize, string keyword, string typeName, Guid parentId)
        {
            var bll = new InfoneProjectReportPrepare();

            if (typeName == "GetProjectsByCustomerId" && parentId != Guid.Empty)
            {
                var prpList = bll.GetProjectsByCustomerId(parentId);
                context.Response.Write(ResResult.ResJsonString(true, "", "{\"total\":" + prpList.Count + ",\"rows\":" + JsonConvert.SerializeObject(prpList) + "}"));
                return;
            }

            int           totalRecord = 0;
            StringBuilder sqlWhere    = null;
            ParamsHelper  parms       = null;

            if (!string.IsNullOrWhiteSpace(keyword))
            {
                parms    = new ParamsHelper();
                sqlWhere = new StringBuilder("and (prp.ProjectName like @Keyword or prp.SpecsModel like @Keyword or prp.ContactMan like @Keyword or prp.ContactPhone like @Keyword) ");
                var parm = new SqlParameter("@Keyword", SqlDbType.NVarChar, 50);
                parm.Value = "%" + keyword + "%";
                parms.Add(parm);
            }
            var list = bll.GetListByJoin(pageIndex, pageSize, out totalRecord, sqlWhere == null ? "" : sqlWhere.ToString(), parms == null ? null : parms.ToArray());

            context.Response.Write(ResResult.ResJsonString(true, "", "{\"total\":" + totalRecord + ",\"rows\":" + JsonConvert.SerializeObject(list) + "}"));
        }
Esempio n. 2
0
        public void GetInfoneProjectReportPrepareInfo(HttpContext context, Guid Id)
        {
            var bll = new InfoneProjectReportPrepare();

            context.Response.Write(ResResult.ResJsonString(true, "", JsonConvert.SerializeObject(bll.GetModelByJoin(Id))));
        }