//ajax发送页面 public ActionResult dacx1() { int dqy = int.Parse(Request["id"].ToString()); salary_grantCan da = sa.fenye(dqy, 2); string aa = JsonConvert.SerializeObject(da); return(Content(aa)); }
public ActionResult JiaZai() { query_locateCan va = Session["query_locateCan"] as query_locateCan; int dqy = int.Parse(Request["id"].ToString()); salary_grantCan da = sa.fenye2(va, dqy, 2); string aa = JsonConvert.SerializeObject(da); return(Content(aa)); }
public salary_grantCan fenye2(query_locateCan va, int dqy, int rl) { string hu = va.year + "-" + va.month + "-1"; string hu2 = va.year + "-" + va.month + "-30"; DateTime t1 = DateTime.Parse(hu); DateTime t2 = DateTime.Parse(hu2); salary_grantCan cs = new salary_grantCan(); List <salary_grantModel> li = new List <salary_grantModel>(); int rows = 0; var data = db.Set <salary_grant>().OrderBy(e => e.id).Where(e => e.salary_standard_id.Contains(va.salaryGrant) && e.check_time >= t1 && e.check_time <= t2).AsNoTracking(); rows = data.Count();//获取总行数 List <salary_grant> list = FenYe <int>(e => e.id, e => e.salary_standard_id.Contains(va.salaryGrant) && e.check_time >= t1 && e.check_time <= t2, ref rows, dqy, rl); foreach (salary_grant item in list) { salary_grantModel ko = new salary_grantModel(); ko.sgr_id = item.id; ko.salary_grant_id = item.salary_grant_id; ko.salary_standard_id = item.salary_standard_id; ko.first_kind_id = item.first_kind_id; ko.first_kind_name = item.first_kind_name; ko.second_kind_id = item.second_kind_id; ko.second_kind_name = item.second_kind_name; ko.third_kind_id = item.third_kind_id; ko.third_kind_name = item.third_kind_name; ko.human_amount = item.human_amount; ko.salary_standard_sum = item.salary_standard_sum; ko.salary_paid_sum = item.salary_paid_sum; ko.register = item.register; ko.regist_time = item.regist_time; ko.checker = item.checker; ko.check_time = item.check_time; ko.check_status = item.check_status; li.Add(ko); } cs.li = li; cs.MyProperty = rows; cs.zys = (rows % rl == 0 ? rows / rl : rows / rl + 1); return(cs); }
public salary_grantCan fenye(int dqy, int rl) { salary_grantCan cs = new salary_grantCan(); List <salary_grantModel> li = new List <salary_grantModel>(); int rows = 0; var data = db.Set <salary_grant>().OrderBy(e => e.id).Where(e => e.check_status == 0).AsNoTracking(); rows = data.Count();//获取总行数 List <salary_grant> list = FenYe <int>(e => e.id, e => e.check_status == 0, ref rows, dqy, rl); foreach (salary_grant item in list) { salary_grantModel ko = new salary_grantModel(); ko.sgr_id = item.id; ko.salary_grant_id = item.salary_grant_id; ko.salary_standard_id = item.salary_standard_id; ko.first_kind_id = item.first_kind_id; ko.first_kind_name = item.first_kind_name; ko.second_kind_id = item.second_kind_id; ko.second_kind_name = item.second_kind_name; ko.third_kind_id = item.third_kind_id; ko.third_kind_name = item.third_kind_name; ko.human_amount = item.human_amount; ko.salary_standard_sum = item.salary_standard_sum; ko.salary_paid_sum = item.salary_paid_sum; ko.register = item.register; ko.regist_time = item.regist_time; ko.checker = item.checker; ko.check_time = item.check_time; ko.check_status = item.check_status; li.Add(ko); } cs.li = li; cs.MyProperty = rows; cs.zys = (rows % rl == 0 ? rows / rl : rows / rl + 1); return(cs); }