public IActionResult GetList(DataTableAjaxPostModel dtpm)
        {
            string        mssg = "";
            int           totrow;
            MasterABP     tm  = new MasterABP(_imap);
            GridModel     gmd = FilterOption.BindToGridModel(dtpm, typeof(MABPVM));
            List <MABPVM> ret = tm.ReadList(gmd, out totrow, ref mssg);

            return(new ContentResult
            {
                ContentType = "application/json",
                Content = JsonConvert.SerializeObject(new { draw = dtpm.draw, recordsFiltered = totrow, recordsTotal = totrow, data = ret }, new JsonSerializerSettings {
                    ContractResolver = new CamelCasePropertyNamesContractResolver()
                })
            });
        }
Пример #2
0
        public IActionResult GetList(DataTableAjaxPostModel dtpm)
        {
            GridModel     gmd = FilterOption.BindToGridModel(dtpm, typeof(MABPVM));
            List <MABPVM> ret = new List <MABPVM>();

            MABPVMDA AbpDA = new MABPVMDA(IM);

            if (AbpDA.ReadListPaged(gmd, ref ExecRes))
            {
                ret = AbpDA.Result.Collection;
            }
            else
            {
                ListMessage.Add(AbpDA.Result.Message);
            }

            return(DataTableRecord(dtpm, ret));
        }
Пример #3
0
        public IActionResult loaddata(DataTableAjaxPostModel dtpm)
        {
            int            totarec = 0;
            var            users   = new List <MKaryawanVM>();
            MKaryawanVMRPO krp     = new MKaryawanVMRPO(imap___);
            ExecResult     exec    = new ExecResult();
            GridModel      grdMdl  = FilterOption.BindToGridModel(dtpm, typeof(MKaryawanVM));

            if (krp.ReadListPaged(grdMdl, out totarec, ref exec))
            {
                users = krp.Result.Collection;
            }

            //Conditions ncon = new Conditions();
            //ncon.AddSelect("ID");
            //ncon.AddSelect("Age");
            //ncon.AddSelect("Name");
            //ncon.AddFilter("Age", Operator.Equals(823458));
            ////ncon.AddGroupBy("Name");
            //ncon.AddOrderBy("ID");
            //ncon.SetOrderAscending();
            //if (krp.ReadOne(ref exec) && krp.Result.AffectedRow>0)
            //{
            //    //users = krp.Result.Collection;
            //}
            //krp.Conditions(ncon);

            ////krp.Conditions("Name", Operator.Like("a"));

            //if (krp.ReadOne(ref exec) && krp.Result.AffectedRow > 0)
            //{
            //    //users = krp.Result.Collection;
            //}
            return(new ContentResult
            {
                ContentType = "application/json",
                Content = JsonConvert.SerializeObject(new { draw = dtpm.draw, recordsFiltered = totarec, recordsTotal = totarec, data = users }, new JsonSerializerSettings {
                    ContractResolver = new CamelCasePropertyNamesContractResolver()
                })
            });
        }