Exemplo n.º 1
0
 public DataBean GetData(string path = "")
 {
     DataBean bean = new DataBean();
     XElement read = XElement.Load(path);
     var nodes = from item in read.Elements("xsjl") select item;
     foreach (var temp in nodes)
     {
         bean.ShcBh = temp.Element("ShcBh").Value;
         bean.ShcDj = temp.Element("ShcDj").Value;
         bean.XSSL = temp.Element("XSSL").Value;
         bean.XSTime = Util.UtiData.StringToDateTime(temp.Element("XSTime").Value);
         bean.Zt = "0";
         bean.ZydBh = temp.Element("ZydBh").Value;
     }
     return bean;
 }
Exemplo n.º 2
0
 public IList<DataBean> GetDataList(string path = "")
 {
     IList<DataBean> beanlist = new List<DataBean>();
     XElement read = XElement.Load(path);
     var nodes = from item in read.Elements("SC") select item;
     foreach (var temp in nodes)
     {
         DataBean bean = new DataBean();
         bean.ShcBh = temp.Element("b").Value;
         bean.ShcDj = temp.Element("c").Value;
         bean.XSSL = temp.Element("d").Value;
         bean.XSTime = Util.UtiData.StringToDateTime(temp.Element("e").Value);
         bean.Zt = "0";
         bean.ZydBh = temp.Element("a").Value;
         bean.JyJlID = temp.FirstAttribute.Value;
         beanlist.Add(bean);
     }
     return beanlist;
 }
Exemplo n.º 3
0
 public IList<Model.DataBean> GetDataList(string path = "")
 {
     IList<DataBean> list = new List<DataBean>();
     string sql = "select * from SalesRecord where State in(0,1)";
     AccessHelper db = new AccessHelper();
     OleDbCommand cmd = db.GetSqlStringCommand(sql);
     DataTable dt = db.ExecuteDataTable(cmd);
     foreach (DataRow VARIABLE in dt.Rows)
     {
         DataBean bena = new DataBean();
         bena.ID = UtiData.DBObjectToInt(VARIABLE["ID"]);
         bena.ShcBh = UtiData.DBObjectToString(VARIABLE["ScBh"]);
         bena.ShcDj = UtiData.DBObjectToString(VARIABLE["ScDj"]);
         bena.XSSL = UtiData.DBObjectToString(VARIABLE["ScZl"]);
         bena.XSTime = UtiData.DBObjectToDateTime(VARIABLE["JyTime"]);
         bena.ZydBh = UtiData.DBObjectToString(VARIABLE["ScZydBh"]);
         bena.JyJlID = UtiData.DBObjectToString(VARIABLE["JyJlID"]);
         list.Add(bena);
     }
     return list;
 }