public List <VisitBill> HisVisit(string userName) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null); } MLogin.GetExeUname(); clientservice_VisitBill bills = new clientservice_VisitBill(); List <clientservice_VisitBill> list = bills.Select(" and billman='" + userName + "' order by id desc ", " top 20 client,billdate,notepre,code"); List <VisitBill> history = new List <VisitBill>(); foreach (clientservice_VisitBill c in list) { VisitBill b = new VisitBill(); b.code = c.CODE; b.client = c.CLIENT; b.date = c.BILLDATE.ToString("yyyy-MM-dd"); b.content = c.NOTEPRE; history.Add(b); } return(history); }
public List <VisitBill> P_HisVisit(string userName, int curPage, int pageSize) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null); } MLogin.GetExeUname(); int num = curPage * pageSize; string sql = "select top " + pageSize.ToString() + " o.* from ( " + " select row_number() over(order by id desc) as rownumber,a.* from( " + " select id, client, billdate, notepre, code from clientservice_VisitBill where billman = '" + userName + "') as a ) as o where rownumber> " + num.ToString(); DataTable dt = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql); List <VisitBill> history = new List <VisitBill>(); foreach (DataRow c in dt.Rows) { VisitBill b = new VisitBill(); b.code = c["CODE"].ToString(); b.client = c["CLIENT"].ToString(); b.date = Convert.ToDateTime(c["BILLDATE"].ToString()).ToString("yyyy-MM-dd"); b.content = c["NOTEPRE"].ToString(); history.Add(b); } return(history); }
public List <VisitBill> GetBills(string userName) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null);//身份验证失败 } MLogin.GetExeUname(); List <VisitBill> result = new List <VisitBill>(); string date = DateTime.Now.Date.ToString(); clientservice_VisitBill bills = new clientservice_VisitBill(); List <clientservice_VisitBill> list = bills.Select(" and billman='" + userName + "' and BILLDATE='" + date + "' ", " client,billdate,notepre,code,zf3,zf4,zf5 ");//公司、拜访时间、内容、单号、名字、职位、电话 foreach (clientservice_VisitBill b in list) { VisitBill v = new VisitBill(); v.client = b.CLIENT; v.code = b.CODE; v.content = b.NOTEPRE; v.date = b.BILLDATE.ToString("yyyy-MM-dd"); v.hisname = b.ZF3; v.hisposition = b.ZF4; v.hisphone = b.ZF5; result.Add(v); } return(result); }