Exemplo n.º 1
0
 /// <summary>
 /// Load lại các đối tượng dùng chung
 /// </summary>
 public static void ReLoadCommon()
 {
     _listStaxiLoaiXe = null;
     _dictDriver      = null;
     _dictDriver_MaNV = null;
     _ListAllCode     = null;
     LoadVehicles();
     LoadDrivers_Active();
     Config_Common.LoadConfigCommon();
     if (Config_Common.NhapTuyenDuongDai || Config_Common.App_DieuXeHopDong)
     {
         CommonBL.LoadTuyenDuongDai();
     }
 }
        private static void LoadDataCommon()
        {
            Config_Common.LoadConfigCommon();
            ThongTinCauHinh.LayThongTinCauHinh();
            CommonBL.LoadDrivers_Active();
            CommonBL.LoadVehicles();

            //CommonBL.LoadStaxiLoaiXe();
            if (Config_Common.NhapTuyenDuongDai || Config_Common.App_DieuXeHopDong)
            {
                CommonBL.LoadTuyenDuongDai();
            }
            try
            {
                using (DataTable dt = QuanTriCauHinh.G5_GetLines_LoaiXeOfPCDienThoai(IpAddress))
                {
                    if (dt.Rows != null && dt.Rows.Count > 0)
                    {
                        LineVung = dt.Rows[0]["Line_Vung"].ToString();

                        if (Config_Common.DienThoai_DieuTuDong)
                        {
                            Config_Common.DienThoai_DieuTuDong = dt.Columns.Contains("G5_Type") &&
                                                                 dt.Rows[0]["G5_Type"].ToString() == "1";
                        }
                        Config_Common.G5_PinMap = dt.Columns.Contains("G5_PinMap") &&
                                                  dt.Rows[0]["G5_PinMap"].ToString() == "1";

                        if (Config_Common.GopLine || ThongTinCauHinh.GopKenh_TrangThai)
                        {
                            LineGop = dt.Rows[0]["LineGop"] == DBNull.Value
                                ? LineVung
                                : dt.Rows[0]["LineGop"].ToString();
                        }
                        QuanTriCauHinh.MoHinh = dt.Columns.Contains("MoHinh") && dt.Rows[0]["MoHinh"] != DBNull.Value && (string)dt.Rows[0]["MoHinh"] != "" && (string)dt.Rows[0]["MoHinh"] != "0" ? (MoHinh)dt.Rows[0]["MoHinh"].To <int>() : MoHinh.TD_DT;
                    }
                    else
                    {
                        LineVung = string.Empty;
                    }
                }
            }
            catch (Exception ex)
            {
                LogError.WriteLogError("GetLines_LoaiXeOfPCDienThoai", ex);
            }
        }