Exemplo n.º 1
0
 private void InitCallLimit(CommonCar Car)
 {
     if (Car != null)
     {
         int num = 0;
         int num2 = 0;
         try
         {
             if (Car.carControlType.Trim().Length > 0)
             {
                 num = int.Parse(Car.carControlType.Trim());
             }
             if (Car.carControlMask.Trim().Length > 0)
             {
                 num2 = int.Parse(Car.carControlMask.Trim());
             }
         }
         catch
         {
             return;
         }
         if ((num & 1) != 0)
         {
             this.rdoCallInOpen.Checked = true;
         }
         else if ((num2 & 1) != 0)
         {
             this.rdoCallInLimit.Checked = true;
             if (Car.callInList != null)
             {
                 this.txtCallIn.Text = Car.callInList.Replace("/", "\r\n");
             }
         }
         else
         {
             this.rdoCallIn.Checked = true;
         }
         if ((num & 2) != 0)
         {
             this.rdoCallOutOpen.Checked = true;
         }
         else if ((num2 & 2) != 0)
         {
             this.rdoCallOutLimit.Checked = true;
             if (Car.callOutList != null)
             {
                 this.txtCallOut.Text = Car.callOutList.Replace("/", "\r\n");
             }
         }
         else
         {
             this.rdoCallIn.Checked = true;
         }
         if ((num & 4) != 0)
         {
             this.rdoRushOpen.Checked = true;
         }
         else if ((num2 & 4) != 0)
         {
             this.rdoRushClose.Checked = true;
         }
         else
         {
             this.rdoRush.Checked = true;
         }
     }
 }
Exemplo n.º 2
0
 private void InitCommArg(CommonCar Car)
 {
     this.cmbServerList.addItems("主服务器", "0");
     this.cmbServerList.addItems("备份服务器", "1");
     DataTable table = new DataTable();
     DataColumn column = new DataColumn("Display");
     DataColumn column2 = new DataColumn("Value");
     table.Columns.AddRange(new DataColumn[] { column, column2 });
     DataRow row = table.NewRow();
     row[0] = "CMNET";
     row[1] = "CMNET";
     DataRow row2 = table.NewRow();
     row2[0] = "CMWAP";
     row2[1] = "CMWAP";
     DataRow row3 = table.NewRow();
     row3[0] = "CARD";
     row3[1] = "CARD";
     table.Rows.Add(row);
     table.Rows.Add(row2);
     table.Rows.Add(row3);
     this.cmbApnType.DataSource = table;
     if (Car == null)
     {
         this.cmbApnType_SelectedIndexChanged(new object(), new EventArgs());
     }
     else
     {
         if (Car.carCommunicationType == "1")
         {
             this.rdoGprsCdma.Checked = true;
         }
         else if (Car.carCommunicationType == "2")
         {
             this.rdoMessage.Checked = true;
         }
         else
         {
             this.rdoMix.Checked = true;
         }
         if (Car.APNAddr != null)
         {
             this.cmbApnType.Text = Car.APNAddr;
         }
         this.txtUser.Text = Car.GPRSUser;
         this.txtPassword.Text = Car.GPRSPassword;
         this.txtTcpIp.Text = Car.TcpIP;
         this.txtTcpPort.Text = Car.TcpPort;
         this.txtUdpIp.Text = Car.UdpIP;
         this.txtUdpPort.Text = Car.UdpPort;
         this.chkSurrogate.Checked = Car.isUseProxy;
         this.txtSurrogateIp.Text = Car.AgentIP;
         this.txtSurrogatePort.Text = Car.AgentPort;
         if (Car.ServerType == 0)
         {
             this.cmbServerList.SelectedIndex = 0;
         }
         else
         {
             this.cmbServerList.SelectedIndex = 1;
         }
     }
 }
Exemplo n.º 3
0
 private void worker_DoWork(object sender, DoWorkEventArgs e)
 {
     string[] strArray = this.sCarId.Split(new char[] { ',' });
     if (strArray.Length > 0)
     {
         m_CommonCar = RemotingClient.Car_GetCarDetailInfoByCarId(strArray[0]);
         this.dtCarConfig = RemotingClient.Car_GetCarConfig(strArray[0]);
     }
 }
Exemplo n.º 4
0
 private void InitCustomAlarm(CommonCar car)
 {
     string strCustName = "";
     int iCarAlarmSwitch = 0;
     int iCarAlarmFlag = 0;
     int iShowAlarm = 0;
     int iCustLevel = 0;
     try
     {
         string pStrNum = car.cust_CarAlarmSwitch;
         string str2 = car.cust_CarAlarmFlag;
         string str3 = car.cust_ShowAlarm;
         string str4 = car.cust_level;
         strCustName = car.cust_Name;
         if (Check.isNumeric(pStrNum, Check.NumType.sInt))
         {
             iCarAlarmSwitch = int.Parse(pStrNum);
         }
         if (Check.isNumeric(str2, Check.NumType.sInt))
         {
             iCarAlarmFlag = int.Parse(str2);
         }
         if (Check.isNumeric(str3, Check.NumType.sInt))
         {
             iShowAlarm = int.Parse(str3);
         }
         if (Check.isNumeric(str4, Check.NumType.sInt))
         {
             iCustLevel = int.Parse(str4);
         }
     }
     catch
     {
     }
     this.SetChooseCustomAlarmIndex(iCarAlarmSwitch, iCarAlarmFlag, iShowAlarm, iCustLevel, strCustName);
 }
Exemplo n.º 5
0
        private void initControl()
        {
            string carId = MainForm.myCarList.SelectedCarId.Split(new char[] { ',' })[0];
            CommonCar car = new CommonCar();
            car = RemotingClient.Car_GetCarDetailInfoByCarId(carId);
            if (car != null)
            {
                this.lblAreaValue.Text = car.areaName;
                this.lblCarIdValue.Text = car.id.ToString();
                this.lblCarNumValue.Text = car.carNum;
                this.lblSimNumValue.Text = car.tele;
                this.lblCarTypeValue.Text = car.carType;
                if (car.svrBeginTime.CompareTo(NullDate) != 0)
                {
                    this.lblServerStartTimeValue.Text = string.Format("{0}", car.svrBeginTime.ToString());
                }
                if (car.svrEndTime.CompareTo(NullDate) != 0)
                {
                    this.lblServerEndTimeValue.Text = string.Format("{0}", car.svrEndTime.ToString());
                }
                this.lblAheadDateValue.Text = car.awokeDays.ToString();
                if (car.createTime.CompareTo(NullDate) != 0)
                {
                    this.lblRegistrationTimeValue.Text = string.Format("{0}", car.createTime.ToString());
                }
                this.lblColorValue.Text = car.CarColor;
                if (car.SimBeginTime.CompareTo(NullDate) != 0)
                {
                    this.lblSimStartTimeValue.Text = string.Format("{0}", car.SimBeginTime.ToString());
                }
                if (car.SimEndTime.CompareTo(NullDate) != 0)
                {
                    this.lblSimEndTimeValue.Text = string.Format("{0}", car.SimEndTime.ToString());
                }
                this.lblSimPasswordValue.Text = car.SIMpassport;
                DateTime now = DateTime.Now;
                bool result = false;
                if (bool.TryParse(this.lblServerEndTimeValue.Text, out result))
                {
                    if (Convert.ToDateTime(this.lblServerEndTimeValue.Text) >= DateTime.Now)
                    {
                        this.txtCarState.Text = "正常运营";
                    }
                    else
                    {
                        this.txtCarState.Text = "停运";
                    }
                }
                else
                {
                    this.txtCarState.Text = "正常运营";
                }

                this.txtPlateColor.Text = car.CarColor;

                //去掉新版本不存在的东西 周立山 2014.1.16
                //this.txtOperateTypeName.Text = car.OperateTypeName;
                this.lblTerminalTypeValue.Text = car.terminalName;
                this.lblTerminalVersionValue.Text = car.terminalSoftVersion;
                if (car.isSupportMSM)
                {
                    this.lblSupportMsgValue.Text = "是";
                }
                else
                {
                    this.lblSupportMsgValue.Text = "否";
                }
                if (car.isSupportGPRS)
                {
                    this.lblSupportGprsValue.Text = "是";
                }
                else
                {
                    this.lblSupportGprsValue.Text = "否";
                }
                if (car.isSupportCDMA)
                {
                    this.lblSupportCdmaValue.Text = "是";
                }
                else
                {
                    this.lblSupportCdmaValue.Text = "否";
                }
                this.txtTermSerial.Text = car.TermSerial;
                this.lblCarBrandValue.Text = car.CarModel;
                this.lblOwnerNameValue.Text = car.OwnerName;
                this.lblOwnerSimNumValue.Text = car.OwnerSimNum;
                this.lblOwnerEmailValue.Text = car.OwnerEmail;
                this.lblIdentityCardValue.Text = car.PersonID;
                this.lblAddressValue.Text = car.HomeAddress;
                this.lblCompanyValue.Text = car.CorpName;
                this.lblFirstLinkmanValue.Text = car.FirstConnectorName;
                this.lblFirstLinkmanTelValue.Text = car.FirstConnectTele;
                this.lblSecondLinkmanValue.Text = car.ConnectorName;
                this.lblSecondLinkmanTelValue.Text = car.ConnectTele;
                this.lblSteelGradeValue.Text = car.SteelGrade;
                this.lblDriverNameValue.Text = car.DrverName;
                this.lblDriverPhoneValue.Text = car.DriverPhone;
                this.lblRemarkValue.Text = car.Remark;
            }
        }
Exemplo n.º 6
0
 public CommonCar GetCarDetailInfoByCarId(string carId)
 {
     CommonCar car = new CommonCar();
     string str = "select a.CarModel, a.CarColor, a.PlateColor, b.TermSerial, a.PersonID, a.HomeAddress, a.ConnectorName, a.FirstConnectTele,a.OtherCommunication, a.CorpName, a.ConnectTele, a.OwnerSimNum, a.OwnerEmail,a.CustomType, a.ReportCenterNum, a.DTMFAlarmNum, a.ListenRecordNum, a.HaveOwnTele,a.MedicalNum, a.RepairNum, a.HelpNum, a.Sex, a.PostCode, a.FirstConnectorName, a.APNAddr,a.GPRSUser, a.GPRSPassword, a.TcpIP, a.TcpPort, a.UdpIP, a.UdpPort, a.AgentIp, a.AgentPort,a.isUseProxy, a.carCommunicationType, a.carAlarmSwitch, a.carAlarmFlag,a.AlarmFlagType,a.AlarmFlagEx,a.CarAlarmSwitchEx,a.CarShowAlarmEx,a.isShowForm,a.callInLst, a.callOutLst, a.MobileCenter, a.carControlType, a.carControlMask,a.cust_carAlarmSwitch, a.cust_carAlarmFlag, a.cust_isShowForm, a.cust_level, a.cust_name, a.ServerType,b.carNum,b.simNum, b.CreateTime, b.OwnerName,b.Remark,b.SIMpassport, b.SVRStartTime, b.SVREndTime, b.SIMbeginTime,b.SIMendTime,b.PromptDays ,d.sms, d.gprs, d.cdma, d.name, e.SoftVersion, f.CarTypeName, c.areaName,a.FactoryPlateModel,g.[name] as drivername,g.telephone,g.LaborQualificationNo from GisCar b INNER JOIN GisCarInfoTable a ON a.CarID = b.CarID  INNER JOIN  GpsArea c ON b.AreaId = c.AreaID  INNER JOIN GpsTerminalType d ON b.TerminalTypeID = d.TerminalTypeID  INNER JOIN GpsProtocol e ON d.ProtocolCode = e.ProtocolCode  INNER JOIN CarTypeTable f ON b.CarType = f.CarType left JOIN gpsdriver g on b.carid=g.carid where a.carID=" + carId;
     DataTable table = new SqlDataAccess().getDataBySql(str);
     if ((table != null) && (table.Rows.Count >= 1))
     {
         DataRow row = table.Rows[0];
         car.id = int.Parse(carId);
         car.carNum = row["carNum"] as string;
         car.tele = row["simNum"] as string;
         car.areaName = row["areaName"] as string;
         car.createTime = (DateTime) row["CreateTime"];
         car.OwnerName = row["OwnerName"] as string;
         car.CarModel = row["CarModel"] as string;
         car.CarColor = row["CarColor"] as string;
         car.platecolor = row["PlateColor"] as string;
         //switch ((row["PlateColor"]==DBNull.Value)?0:int.Parse(row["PlateColor"].ToString()))
         //{
         //    case 1:
         //        car.platecolor = "蓝色";
         //        break;
         //    case 2:
         //        car.platecolor = "黄色";
         //        break;
         //    case 3:
         //        car.platecolor = "黑色";
         //        break;
         //    case 4:
         //        car.platecolor = "白色";
         //        break;
         //    case 9:
         //        car.platecolor = "其他";
         //        break;
         //    default:
         //        car.platecolor = string.Empty;
         //        break;
         //};
         car.TermSerial = row["TermSerial"] as string;
         car.PersonID = row["PersonID"] as string;
         car.HomeAddress = row["HomeAddress"] as string;
         car.ConnectorName = row["ConnectorName"] as string;
         car.FirstConnectTele = row["FirstConnectTele"] as string;
         car.OtherCommunication = row["OtherCommunication"] as string;
         car.CorpName = row["CorpName"] as string;
         car.ConnectTele = row["ConnectTele"] as string;
         car.OwnerSimNum = row["OwnerSimNum"] as string;
         car.CustomType = row["CustomType"] as string;
         car.OwnerEmail = row["OwnerEmail"] as string;
         car.Remark = row["Remark"] as string;
         car.ReportCenterNum = row["ReportCenterNum"] as string;
         car.DTMFAlarmNum = row["DTMFAlarmNum"] as string;
         car.HaveOwnTele = row["HaveOwnTele"] as string;
         car.ListenRecordNum = row["ListenRecordNum"] as string;
         car.MedicalNum = row["MedicalNum"] as string;
         car.RepairNum = row["RepairNum"] as string;
         car.HelpNum = row["HelpNum"] as string;
         car.MobileCenterNum = row["MobileCenter"] as string;
         car.APNAddr = row["APNAddr"] as string;
         car.GPRSUser = row["GPRSUser"] as string;
         car.GPRSPassword = row["GPRSPassword"] as string;
         car.TcpIP = row["TcpIP"] as string;
         car.TcpPort = row["TcpPort"] as string;
         car.UdpPort = row["UdpPort"] as string;
         car.UdpIP = row["UdpIP"] as string;
         car.AgentIP = row["AgentIP"] as string;
         car.AgentPort = row["AgentPort"] as string;
         car.isUseProxy = (bool) row["isUseProxy"];
         car.AlarmPathDot = "";
         car.carCommunicationType = row["carCommunicationType"] as string;
         car.carControlType = row["carControlType"] as string;
         car.carControlMask = row["carControlMask"] as string;
         car.CarAlarmSwitch = row["carAlarmSwitch"] as string;
         car.CarAlarmFlag = row["CarAlarmFlag"] as string;
         car.ShowAlarm = row["isShowForm"] as string;
         car.AlarmFlagType = (row["AlarmFlagType"] == DBNull.Value) ? -1 : int.Parse(row["AlarmFlagType"].ToString());
         car.CarAlarmFlagEx = (row["AlarmFlagEx"] == DBNull.Value) ? "" : row["AlarmFlagEx"].ToString();
         car.CarAlarmSwitchEx = (row["CarAlarmSwitchEx"] == DBNull.Value) ? "" : row["CarAlarmSwitchEx"].ToString();
         car.ShowAlarmEx = (row["CarShowAlarmEx"] == DBNull.Value) ? "" : row["CarShowAlarmEx"].ToString();
         car.ServerType = (row["ServerType"] == DBNull.Value) ? -1 : int.Parse(row["ServerType"].ToString());
         car.DrverName = (row["drivername"] == DBNull.Value) ? "" : row["drivername"].ToString();
         car.DriverPhone = (row["telephone"] == DBNull.Value) ? "" : row["telephone"].ToString();
         car.SteelGrade = (row["FactoryPlateModel"] == DBNull.Value) ? "" : row["FactoryPlateModel"].ToString();
         car.callInList = row["callInLst"] as string;
         car.callOutList = row["callOutLst"] as string;
         if (row["SVRStartTime"] != DBNull.Value)
         {
             car.svrBeginTime = (DateTime) row["SVRStartTime"];
         }
         if (row["SVREndTime"] != DBNull.Value)
         {
             car.svrEndTime = (DateTime) row["SVREndTime"];
         }
         if (row["SIMbeginTime"] != DBNull.Value)
         {
             car.SimBeginTime = (DateTime) row["SIMbeginTime"];
         }
         if (row["SIMendTime"] != DBNull.Value)
         {
             car.SimEndTime = (DateTime) row["SIMendTime"];
         }
         if (row["PromptDays"] != DBNull.Value)
         {
             car.awokeDays = (int) row["PromptDays"];
         }
         if (row["Sex"] == DBNull.Value)
         {
             car.Sex = this.method_2(3);
         }
         else
         {
             car.Sex = this.method_2(int.Parse(row["Sex"].ToString()));
         }
         car.PostCode = row["PostCode"] as string;
         car.FirstConnectorName = row["FirstConnectorName"] as string;
         car.regionDotStr = "";
         car.terminalName = row["name"] as string;
         car.terminalSoftVersion = row["SoftVersion"] as string;
         car.isSupportMSM = (bool) row["sms"];
         car.isSupportGPRS = (bool) row["gprs"];
         car.isSupportCDMA = (bool) row["cdma"];
         car.carType = row["carTypeName"] as string;
         try
         {
             car.cust_CarAlarmSwitch = row["cust_carAlarmSwitch"] as string;
             car.cust_CarAlarmFlag = row["cust_CarAlarmFlag"] as string;
             car.cust_ShowAlarm = row["cust_isShowForm"] as string;
             car.cust_level = row["cust_level"] as string;
             car.cust_Name = row["cust_name"] as string;
             car.SIMpassport = row["SIMpassport"] as string;
         }
         catch
         {
         }
         car.LaborQualificationNo = row["LaborQualificationNo"] as string;
     }
     return car;
 }
Exemplo n.º 7
0
 private void InitControl()
 {
     string sCarID = this.sCarID;
     CommonCar car = new CommonCar();
     car = RemotingClient.Car_GetCarDetailInfoByCarId(sCarID);
     if (car != null)
     {
         this.lblAreaValue.Text = car.areaName;
         this.lblCarNumValue.Text = car.carNum;
         this.lblCarIdValue.Text = car.id.ToString();
         this.lblSimNumValue.Text = car.tele;
         this.lblOwnerNameValue.Text = car.OwnerName;
         this.lblOwnerSimNumValue.Text = car.OwnerSimNum;
         this.lblCompanyValue.Text = car.CorpName;
         this.lblFirstLinkmanValue.Text = car.FirstConnectorName;
         this.lblFirstLinkmanTelValue.Text = car.FirstConnectTele;
         this.lblCarBrandValue.Text = car.CarModel;
         this.lblColorValue.Text = car.CarColor;
         this.lblSecondLinkmanValue.Text = car.ConnectorName;
         this.lblSecondLinkmanTelValue.Text = car.ConnectTele;
         this.lblIdentityCardValue.Text = car.PersonID;
         this.lblAddressValue.Text = car.HomeAddress;
         this.lblOwnerSimNumValue.Text = car.OwnerSimNum;
         this.lblOwnerSexValue.Text = car.Sex;
         this.lblPostCodeValue.Text = car.PostCode;
     }
 }