public JsonResult LoadData(string salesCode, string salesName, string mobile, GridPager pager) { List <SalespersonViewModel> data = new SalespersonBLL().GetSalesPersonPager(salesCode, salesName, mobile, ref pager); var obj = data.ToGridJson(pager, r => new { id = r.Id, cell = new { Id = r.Id, SaleCode = r.SaleCode, SaleName = r.SaleName, Gender = (r.Gender == 0?"Male":"Female"), Position = r.Position, Mobile = r.Mobile, AgentCount = r.AgentCount, CreateTime = r.CreateTime.ToString("yyyy-MM-dd") } }); return(Json(obj)); }
public JsonResult Delete(int id) { var sr = new SalespersonBLL().Delete(id, UserId, UserName); return(Json(sr.toJson())); }