public List <WXOBJ1> AfterSRepair_P(string userName, int type, 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 where = " and BILLMAN='" + userName + "' and zf3 <> '' and left(code,1) <> '*' "; if (type == 0) { where += " and ((zf2='' and sz10=0 ) or (zf2<>'" + userName + "')) ";//未接收 } else if (type == 1) { where += " and zf2='" + userName + "' and id in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id) and OPERATE_TYPE = '接受' and BILLMAN ='" + userName + "' ) ";//处理中 } else if (type == 2) { where += " and zf2='" + userName + "' and id in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id) and OPERATE_TYPE = '完结' and BILLMAN ='" + userName + "' ) ";//维修完成 } else { } List <WXOBJ1> ms = new List <WXOBJ1>(); string sql = " select top " + pageSize.ToString() + " o.* from ( " + " select row_number() over(order by id desc) as rownumber, N_A.* from( " + " select * from clientservice_AfterServiceBill " + " where 1 = 1 " + where + " ) as N_A) as o where rownumber> " + num.ToString(); DataTable dt = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql); foreach (DataRow row in dt.Rows) { WXOBJ1 o = new WXOBJ1(); o.ID = Convert.ToInt32(row["ID"].ToString()); o.CODE = row["CODE"].ToString();//维修单号 o.BILLMAN = row["BILLMAN"].ToString(); o.CLIENT = row["CLIENT"].ToString(); o.BILLTYPE = row["BILLTYPE"].ToString(); o.ZF1 = row["ZF1"].ToString(); //机床编号 o.NOTEPRE = row["NOTEPRE"].ToString(); //内容描述(电话回访) o.ZF3 = row["ZF3"].ToString(); //分析描述 初判断 o.CONTACT = row["ZF27"].ToString(); o.PHONE = row["ZF28"].ToString(); o.ZF5 = row["ZF5"].ToString(); ms.Add(o); } return(ms); }
public List <WXOBJ1> AfterSRepair(string userName, int type) { 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(); string where = " and BILLMAN='" + userName + "' and zf3 <> '' and left(code,1) <> '*' "; string by = " top 20 * "; if (type == 0) { where += " and ((zf2='' and sz10=0 ) or (zf2<>'" + userName + "')) order by id desc ";//未接收 } else if (type == 1) { where += " and zf2='" + userName + "' and id in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id) and OPERATE_TYPE = '接受' and BILLMAN ='" + userName + "' ) order by id desc";//处理中 } else if (type == 2) { where += " and zf2='" + userName + "' and id in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id) and OPERATE_TYPE = '完结' and BILLMAN ='" + userName + "' ) order by id desc";//维修完成 } else { } List <WXOBJ1> ms = new List <WXOBJ1>(); clientservice_AfterServiceBill bill = new clientservice_AfterServiceBill(); List <clientservice_AfterServiceBill> list = bill.Select(where, by); foreach (clientservice_AfterServiceBill c in list) { WXOBJ1 o = new WXOBJ1(); o.ID = c.ID; o.CODE = c.CODE;//维修单号 o.BILLMAN = c.BILLMAN; o.CLIENT = c.CLIENT; o.BILLTYPE = c.BILLTYPE; o.ZF1 = c.ZF1; //机床编号 o.NOTEPRE = c.NOTEPRE; //内容描述(电话回访) o.ZF3 = c.ZF3; //分析描述 初判断 o.CONTACT = c.ZF27; o.PHONE = c.ZF28; o.ZF5 = c.ZF5; ms.Add(o); } return(ms); }
public List <WXOBJ1> NeibuWx(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 <WXOBJ1> ms = new List <WXOBJ1>(); BILLnouse2 JC = new BILLnouse2(); string where = "and BILLTYPE ='售后返厂维修' and (isnull(Paytype,'')<>'')and left(code,1)<>'*' and (freenum5 is null or freenum5 < 1)"; List <BILLnouse2> bs = JC.Select(where, " PAYTYPE "); string str = string.Empty; foreach (BILLnouse2 h in bs) { str += "'" + h.PAYTYPE + "',"; } str = str.Substring(0, str.Length - 1); clientservice_AfterServiceBill bill = new clientservice_AfterServiceBill(); List <clientservice_AfterServiceBill> list = bill.Select(" and BILLMAN='" + userName + "' and code in (" + str + ")"); foreach (clientservice_AfterServiceBill c in list) { WXOBJ1 o = new WXOBJ1(); o.BILLMAN = c.BILLMAN; o.CLIENT = c.CLIENT; o.BILLTYPE = c.BILLTYPE; o.ZF1 = c.ZF1; ms.Add(o); } return(ms); }