public JsonResult FeeListJson(int page, int limit) { var query = from row in Fee.GetFeeListAll().AsEnumerable() select new Fee { Approver = row.Field <string>("Approver"), ApproverID = row.Field <Guid>("ApproverID"), CrTime = row.Field <DateTime>("CrTime"), CrUser = row.Field <string>("CrUser"), CrUserID = row.Field <Guid>("CrUserID"), ID = row.Field <Guid>("ID"), IsPay = row.Field <bool>("IsPay"), Money = row.Field <decimal>("Money"), OrderID = row.Field <int>("OrderID"), OrderNo = row.Field <string>("OrderNo"), PayeeID = row.Field <Guid>("PayeeID"), PayeeTrueName = row.Field <string>("PayeeTrueName"), PayeeUserName = row.Field <string>("PayeeUserName"), ApproveTime = row.Field <DateTime?>("ApproveTime"), PayDate = row.Field <DateTime?>("PayDate") }; var data = new JsonReturn(query, page, limit); return(Json(data, JsonRequestBehavior.AllowGet)); }
public ActionResult MyCommission() { var dt = Fee.GetFeeListAll("PayeeID='" + DBUserInfo.UserID + "'"); var waitFee = from row in dt.AsEnumerable() where row.Field <bool>("IsPay") == false select new FeeQuery { Money = row.Field <decimal>("Money"), OrderID = row.Field <int>("OrderID"), OrderNo = row.Field <string>("OrderNo"), PayDate = row.Field <DateTime?>("PayDate"), ApplyDate = row.Field <DateTime>("ApplyDate"), CusName = row.Field <string>("CusName"), CusPhone = row.Field <string>("CusPhone") }; var waitFeeSum = waitFee.Sum(t => t.Money); var overFee = from row in dt.AsEnumerable() where row.Field <bool>("IsPay") == true select new FeeQuery { Money = row.Field <decimal>("Money"), OrderID = row.Field <int>("OrderID"), OrderNo = row.Field <string>("OrderNo"), PayDate = row.Field <DateTime?>("PayDate"), ApplyDate = row.Field <DateTime>("ApplyDate"), CusName = row.Field <string>("CusName"), CusPhone = row.Field <string>("CusPhone") }; var overFeeSum = overFee.Sum(t => t.Money); ViewBag.WaitFee = waitFee.ToList(); ViewBag.OverFee = overFee.ToList(); ViewBag.WaitFeeSum = waitFeeSum.ToString("F2"); ViewBag.OverFeeSum = overFeeSum.ToString("F2"); return(View()); }