Ejemplo n.º 1
0
 public static BearingAlarm SetValue(BearingAlarm bearing, DataRow dr)
 {
     if (dr != null)
     {
         bearing.strID      = dr["strID"].ToString();
         bearing.JiCheID    = PageBase.static_ext_int(dr["JiCheID"]);
         bearing.cdatetime  = PageBase.static_ext_date(dr["cdatetime"]);
         bearing.shaftcode  = PageBase.static_ext_int(dr["shaftcode"]);
         bearing.pointccode = PageBase.static_ext_int(dr["pointccode"]);
         bearing.alarmtype  = dr["alarmtype"].ToString();
     }
     return(bearing);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 返回list对象
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public static List <BearingAlarm> ListValue(DataTable dt)
        {
            List <BearingAlarm> bearingList = new List <BearingAlarm>();
            BearingAlarm        bearing;

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    bearing            = new BearingAlarm();
                    bearing.JiCheID    = PageBase.static_ext_int(dt.Rows[i]["JiCheID"]);
                    bearing.cdatetime  = PageBase.static_ext_date(dt.Rows[i]["cdatetime"]);
                    bearing.shaftcode  = PageBase.static_ext_int(dt.Rows[i]["shaftcode"]);
                    bearing.pointccode = PageBase.static_ext_int(dt.Rows[i]["pointccode"]);
                    bearing.alarmtype  = dt.Rows[i]["alarmtype"].ToString();
                    bearingList.Add(bearing);
                }
            }
            return(bearingList);
        }