Пример #1
0
        public ActionResult Customer()
        {
            var model = new ReportCustomerSearchViewModel();


            List <ReportCustomerListViewModel> list = new List <ReportCustomerListViewModel>();

            model.ReportCustomerList = list.ToPagedList(model.Page ?? 1, 20);

            return(View(model));
        }
Пример #2
0
        public ActionResult Customer(ReportCustomerSearchViewModel model)
        {
            if (ModelState.IsValid)
            {
                string sql       = "select msg_S_0088 as Id,#msg_S_0158 as EvrakCinsId,msg_S_0089 as Tarih,msg_S_0090 as EvrakSeri,msg_S_0091 as EvrakSira,msg_S_0094 as EvrakTip,msg_S_0003 as EvrakCinsi,msg_S_0098 as VadeTarih,#msg_S_0165 as Miktar,msg_S_0100 as BA,[msg_S_0101\\T] as Borc,[msg_S_0102\\T] as Alacak,msg_S_0115 as KarsiHesapIsmi from  dbo.fn_CariFoy (N'0',0,'" + model.CariKod + "',NULL,'" + model.DevirDate + "','" + model.startDate + "','" + model.endDate + "',0,N'')";
                int    pageIndex = model.Page ?? 1;

                var data = _viewCustomerReportORM.GetList(sql);
                List <ReportCustomerListViewModel> list = new List <ReportCustomerListViewModel>();
                if (data.Count > 0)
                {
                    foreach (var item in data)
                    {
                        ReportCustomerListViewModel cus = new ReportCustomerListViewModel();
                        cus.Alacak         = item.Alacak;
                        cus.Borc           = item.Borc;
                        cus.BA             = item.BA;
                        cus.EvrakCinsi     = item.EvrakCinsi;
                        cus.EvrakCinsId    = item.EvrakCinsId;
                        cus.EvrakSeri      = item.EvrakSeri;
                        cus.EvrakSira      = item.EvrakSira;
                        cus.EvrakTip       = item.EvrakTip;
                        cus.Id             = item.Id;
                        cus.KarsiHesapIsmi = item.KarsiHesapIsmi;
                        cus.Miktar         = item.Miktar;
                        cus.Tarih          = item.Tarih;
                        cus.VadeTarih      = item.VadeTarih;
                        list.Add(cus);
                    }
                }
                model.ReportCustomerList = list.ToPagedList(pageIndex, 10);
                if (Request.IsAjaxRequest())
                {
                    return(PartialView("_reportcustomerlist", model));
                }

                return(View(model));
            }


            return(View(model));
        }