public string ReviewList(string code) { List <YpReview> list = new List <YpReview>(); //WHERE kfbh = '20153' if (code.Length == 5 || code.Length == 4) { code = cache.SysConfig.GetValue("CheckViewPrefix") + code; } string sql = string.Format(@"select TOP 10 id,sphh,yphh,lsdj,mlcf,ypmc,ysbs psbs,ysr psr,ysrq psrq,ztbs,ppbs from yx_T_ypdmb WHERE kfbh LIKE '{1}' and yphh like '%{0}%' OR bq='{0}'", code, cache.SysConfig.GetValue("CheckViewYearSeason")); using (IDataReader dr = dal.ExecuteReader(sql)) { while (dr.Read()) { YpReview yy = new YpReview(); yy.Id = int.Parse(dr[0].ToString()); yy.Sphh = dr[1].ToString(); yy.Yphh = dr[2].ToString(); yy.Lsdj = decimal.Parse(dr[3].ToString()); yy.Mlcf = dr[4].ToString(); yy.Ypmc = dr[5].ToString(); yy.Psbs = dr[6].ToString(); yy.Psr = dr[7].ToString(); yy.Psrq = dr[8].ToString(); yy.Iszt = dr[9].ToString(); yy.Ispp = dr[10].ToString(); yy.IsEnable = true; list.Add(yy); } } return(ToString <List <YpReview> >(list)); }
public string CutInfo() { List <Dictionary <string, object> > list = new List <Dictionary <string, object> >(); string sql = @"SELECT a.id,a.rq,a.djh,a.sphh,a.chdm,b.pc AS ch ,b.mksl ,b.mkid ,b.cs AS lbcs ,b.jhyl, b.bfsq, b.sl , b.ccbfsl sjsl,d.mc bmmc,e.dw,f.mc CatName,e.chmc,b.bfsqrq,b.ddzt,b.ccblr,b.cjllr,a.zdr FROM sc_T_sccjb a INNER JOIN sc_T_sccjmx b ON b.id = a.id INNER JOIN sc_T_scbmb d on a.cjid=d.id inner join cl_t_chdmb e on a.chdm=e.chdm INNER JOIN dbo.CL_T_Chlb f ON e.chlbid=f.id WHERE a.tzid = 11360 AND b.bfsqrq >= '{0:yyyy-MM-dd}' AND b.bfsq >= 1 and b.bfsq<>3";//3领料确认 =4通知领料 sql = string.Format(sql, DateTime.Now); using (IDataReader dr = dal.ExecuteReader(sql)) { while (dr.Read()) { Dictionary <string, object> info = new Dictionary <string, object>(); info.Add("sphh", dr["sphh"]); info.Add("ch", dr["ch"]); info.Add("sl", dr["sl"]); info.Add("sjsl", dr["sjsl"]); info.Add("bmmc", dr["bmmc"]); info.Add("dw", dr["dw"]); info.Add("CatName", dr["CatName"]); info.Add("chmc", dr["chmc"]); info.Add("chdm", dr["chdm"]); info.Add("bfsqrq", dr["bfsqrq"]); info.Add("ddzt", dr["bfsq"]); info.Add("zdr", dr["zdr"]); list.Add(info); } } return(JsonConvert.SerializeObject(list)); }
public string YphhList(string kfbh, int splbid) { List <ListYFYYSP> yyList = new List <ListYFYYSP>(); using (IDataReader dr = dal.ExecuteReader(String.Format(@"select t2.ypbh,t2.ypzlbh,T4.DM+'.'+t4.mc LB,T1.lsdj1 lsdj,t3.zlmxid,T3.MYPIC from yf_t_cpkfjh as t1 inner join yf_t_cpkfzlb as t2 on t1.id=t2.id INNER JOIN yf_t_cpkfsjtg as t3 on t2.zlmxid=t3.zlmxid and t3.tplx='sjtg' INNER JOIN YX_T_Splb AS T4 ON T1.SPLBID=T4.ID where t1.kfbh='{0}' and t1.splbid={1} ", kfbh, splbid))) { while (dr.Read()) { ListYFYYSP yy = new ListYFYYSP(); yy.Yphh = dr[0].ToString(); yy.Ypzlbh = dr[1].ToString(); yy.Splbmc = dr[2].ToString(); yy.Lsdj = dr[3].ToString(); yy.Zlmxid = int.Parse(dr[4].ToString()); yyList.Add(yy); } } return(ToString <List <ListYFYYSP> >(yyList)); }
public string list(DateTime datestart, DateTime dateend) { /* * khid='16434' 强兴 * --and t2.xmzjybs=1 厂家签收标识 */ string sql = String.Format(@"select t1.rq, t1.zdr, t1.djh, t1.bz, t1.id,t2.chdm,t2.xmzjybs from YX_T_dddjb t1 inner join cl_T_sygzb t2 on t1.id=t2.lymxid and gzlx = 1011 and t2.khid='16434' and t1.djlx=905 and t1.djzt=1 AND t1.rq>='{0:yyyy-MM-dd}' and t1.rq<'{1:yyyy-MM-dd}' ", datestart, dateend.AddDays(1)); List <OrderList> list = new List <OrderList>(); using (IDataReader reader = dal.ExecuteReader(sql)) { while (reader.Read()) { OrderList order = new OrderList(); order.Id = reader["id"].ToString(); order.Ordersn = reader["djh"].ToString(); order.Odate = reader["rq"].ToString(); order.Note = reader["bz"].ToString(); order.Chdm = reader["chdm"].ToString(); order.Isqs = reader["xmzjybs"].ToString(); order.Creater = reader["zdr"].ToString(); list.Add(order); } } return(xmlHelper.ToString <List <OrderList> >(list)); }