예제 #1
0
        private List <CarReport_LCTJView> GetCarRptLCTJList(ArrayList terNos, DataTable dt)
        {
            List <CarReport_LCTJView> list = new List <CarReport_LCTJView>();

            if (terNos.Count > 0)
            {
                foreach (DictionaryEntry e in terNos)
                {
                    DataRow[] foundRows = dt.Select(" TER_NO = '" + e.Value.ToString() + "'");

                    if (foundRows.Length > 0)
                    {
                        DataRow dr = foundRows[0];

                        CarReport_LCTJView node = new CarReport_LCTJView();

                        node.TerNo     = dr["ter_no"].ToString();
                        node.TerTypeid = dr["ter_typeid"].ToString();
                        node.CarNo     = dr["car_no"].ToString();

                        if (dr["rtime"] != DBNull.Value)
                        {
                            node.Rtime = Convert.ToDateTime(dr["rtime"]).ToString("yyyy-MM-dd HH:mm:ss");
                        }
                        node.Position = dr["position"].ToString();


                        double lc = 0;

                        if (foundRows.Length == 2)
                        {
                            DataRow dr1 = foundRows[1];

                            if ((dr["REMAINL_PCT"] != DBNull.Value) &&
                                (dr1["REMAINL_PCT"] != DBNull.Value))
                            {
                                lc = int.Parse(dr1["REMAINL_PCT"].ToString(), System.Globalization.NumberStyles.HexNumber)
                                     - int.Parse(dr["REMAINL_PCT"].ToString(), System.Globalization.NumberStyles.HexNumber);

                                lc = lc / 1000;
                            }
                        }

                        node.LCTJ = lc;
                        node.FXJG = "";

                        list.Add(node);
                    }
                }
            }

            return(list);
        }
예제 #2
0
        public IList <CarReport_LCTJView> GetVis_Carlist_ViewPage(string CurUserDeptCode)
        {
            IList <CarReport_LCTJView> list = new List <CarReport_LCTJView>();

            DataTable dt = _iCarReportDao.GetVis_Carlist_dt2(CurUserDeptCode);

            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    CarReport_LCTJView node = new CarReport_LCTJView();

                    node.TerNo = dr["ter_no"].ToString();
                    node.CarNo = dr["car_no"].ToString();

                    node.Rtime    = dr["rtime"].ToString();
                    node.Position = dr["position"].ToString();

                    double lc = 0;
                    if (dr["REMAINL_PCT"] != DBNull.Value)
                    {
                        lc = int.Parse(dr["REMAINL_PCT"].ToString(),
                                       System.Globalization.NumberStyles.HexNumber);

                        lc = lc / 1000;
                    }

                    node.LCTJ = lc;
                    node.FXJG = "";

                    list.Add(node);
                }
            }

            return(list);
        }