Beispiel #1
0
 public void refreshList(FormMain f, List<Declare> list)
 {
     frmMain = f;
     decList = list;
     listView1.Items.Clear();
     try
     {
     }
     catch { };
     foreach(Declare dec in decList)
     {
         ListViewItem item = new ListViewItem(dec.DeclareID.ToString());
         item.SubItems.Add(dec.ReferDate);
         item.SubItems.Add(dec.DeclareContent);
         Car car = FormMain.user.GetCarByID(dec.CarID);
         if(car != null)
         {
             item.SubItems.Add(car.CarNO);
             if(dec.OpUser != "")
             {
                 item.SubItems.Add("��");
                 item.SubItems.Add(dec.Operation);
                 item.SubItems.Add(dec.Fittings);
                 item.SubItems.Add(dec.Mechanic);
                 item.SubItems.Add(dec.Opinion);
                 item.SubItems.Add(dec.OpUser);
                 item.SubItems.Add(dec.OpDate);
             }
             else item.SubItems.Add("��");
             item.Tag = dec;
             listView1.Items.Add(item);
         }
     }
 }
Beispiel #2
0
        public FormCar(FormMain fMain, Car car)
        {
            InitializeComponent();
            frmMain = fMain;
            if(car.CarNO == "")
                this.Text = "��ӳ���";
            else dateTimePicker13.Enabled = false;
            this.SetFormStyle(false, false, false, false);
            this.temp = car;
            labelTeam.Text = car.Team.TeamName;
            textBox00.Text = temp.CarNO;
            textBox0.Text = temp.SimNO;
            textBox0.KeyPress += Pub.KeyPress_NumInput;
            textBox1.Text = temp.MachineNO;
            //textBox1.KeyPress += Pub.KeyPress_NumInput;
            textBox2.Text = temp.ControlPassword;
            textBox3.Text = temp.MachineType;
            foreach(String s in Car.PROTOCOL)
                comboBox4.Items.Add(s);
            if(temp.Protocol < comboBox4.Items.Count)
                comboBox4.SelectedIndex = temp.Protocol;
            else comboBox4.SelectedIndex = 0;
            foreach(String s in Car.RoutewayList)
                comboBox5.Items.Add(s);
            if(comboBox5.Items.Count == 0)
                comboBox5.Enabled = false;
            if(temp.Routeway < comboBox5.Items.Count)
                comboBox5.SelectedIndex = temp.Routeway;
            else comboBox5.SelectedIndex = 0;
            comboBox6.Text = temp.CarBrand;
            comboBox7.Text = temp.CarType;
            comboBox8.Text = temp.CarColor;
            textBox9.Text = temp.InstallPlace;
            textBox10.Text = temp.InstallPerson;
            textBox11.Text = temp.BusinessPerson;
            try{ dateTimePicker12.Value = DateTime.Parse(temp.JoinTime); }catch{}
            try{ dateTimePicker13.Value = DateTime.Parse(temp.OverServiceTime);}catch{}
            textBox14.Text = temp.CarRemark;

            textBox15.Text = temp.Driver;
            textBox16.Text = temp.DriverTel;
            textBox16.KeyPress += Pub.KeyPress_NumInput;
            textBox17.Text = temp.DriverMobile;
            textBox17.KeyPress += Pub.KeyPress_NumInput;
            textBox18.Text = temp.Driver2;
            textBox19.Text = temp.Driver2Tel;
            textBox19.KeyPress += Pub.KeyPress_NumInput;
            textBox20.Text = temp.Driver2Mobile;
            textBox20.KeyPress += Pub.KeyPress_NumInput;
            textBox21.Text = temp.Password;
            textBox22.Text = temp.DriverAddress;
            textBox23.Text = temp.DriverFax;
            textBox24.Text = temp.DriverCompany;
            try { dateTimePicker25.Value = DateTime.Parse(temp.BuyTime); }catch { }
            textBox26.Text = temp.SpecialRequest;
            textBox27.Text = temp.DriverRemark;
            inited = true;
            frmMain.onModifyCar += new FormMain.onModifyCarDelegate(frmMain_onModifyCar);
        }
Beispiel #3
0
 public FormHandleAlarm(FormMain frm, Car c)
 {
     mainFrm = frm;
     InitializeComponent();
     this.SetFormStyle(false, false, false, true);
     FormMain.inAlarmHandle = true;
     car = c;
     foreach(AlarmPosition apos in FormMain.alarmList)
     {
         if(apos.Car == car)
         {
             ListViewItem item = new ListViewItem(apos.Id.ToString());
             listView1.Items.Add(item);
             item.SubItems.Add(apos.Car.CarNO);
             item.SubItems.Add(apos.GpsTime);
             item.SubItems.Add(Position.POINTED[apos.Pointed]);
             item.SubItems.Add(apos.Lo.ToString());
             item.SubItems.Add(apos.La.ToString());
             item.SubItems.Add(Position.DIR[apos.Direction]);
             item.SubItems.Add(apos.Speed.ToString());
             item.SubItems.Add(apos.Status);
             item.SubItems.Add(apos.Alarm);
             item.Tag = apos;
         }
     }
     label0.Text = car.CarNO;
     label1.Text = car.SimNO;
     label2.Text = car.MachineNO;
     label3.Text = car.ControlPassword;
     label4.Text = car.MachineType;
     label5.Text = Car.PROTOCOL[car.Protocol];
     label6.Text = Car.RoutewayList[car.Routeway];
     label7.Text = car.CarType;
     label8.Text = car.CarBrand;
     label9.Text = car.CarColor;
     label10.Text = car.InstallPlace;
     label11.Text = car.InstallPerson;
     label12.Text = car.BusinessPerson;
     label13.Text = car.JoinTime;
     label14.Text = car.OverServiceTime;
     label15.Text = car.CarRemark;
     label16.Text = car.Driver;
     label17.Text = car.DriverTel;
     label18.Text = car.DriverMobile;
     label19.Text = car.Driver2;
     label20.Text = car.Driver2Tel;
     label21.Text = car.Driver2Mobile;
     label22.Text = car.Password;
     label23.Text = car.DriverAddress;
     label24.Text = car.DriverFax;
     label25.Text = car.DriverCompany;
     label26.Text = car.BuyTime;
     label27.Text = Car.SERVICE_STATUS[car.Stoped];
     label28.Text = car.SpecialRequest;
     label29.Text = car.DriverRemark;
     frm.onAlarm += new FormMain.onAlarmDelegate(frm_onAlarm);
     frm.onDisconn += new FormMain.onDisconnDelegate(frm_onDisconn);
 }
Beispiel #4
0
 public FormPtTianHe(FormMain frm, List<Team> list, int cid)
 {
     InitializeComponent();
     this.SetFormStyle(false, false, false, false);
     mainFrm = frm;
     panels.Add(panel0); panels.Add(panel1);
     panels.Add(panel100);
     panels.Add(panel2); panels.Add(panel3); panels.Add(panel4);
     panels.Add(panel5); panels.Add(panel6); panels.Add(panel7);
     panels.Add(panel101);
     panels.Add(panel8); panels.Add(panel9);
     panels.Add(panel10); panels.Add(panel11);
     panels.Add(panel102);
     panels.Add(panel103);
     panels.Add(panel104);
     panels.Add(panel105);
     panels.Add(panel106);
     teamList = list;
     foreach(Team team in teamList)
     {
         TreeNode ttn = treeView1.Nodes.Add(team.TeamName);
         ttn.Tag = team;
         foreach(Car car in team.Cars)
         {
             if(car.Protocol != Constant.PROTOCOL_TIANHE)
                 continue;
             TreeNode ctn = ttn.Nodes.Add(car.CarNO + "[" + car.Driver + "]");
             ctn.Tag = car;
             if(car.CarID == cid)
             {
                 treeView1.SelectedNode = ctn;
                 ctn.Checked = true;
             }
         }
     }
     treeView1.ExpandAll();
     comboBox51.SelectedIndex = 0;
     comboBox61.SelectedIndex = 0;
     comboBox90.SelectedIndex = 0;
     comboBox91.SelectedIndex = 1;
     comboBox100.SelectedIndex = 0;
     comboBox101.SelectedIndex = 0;
     comboBox110.SelectedIndex = 0;
     comboBox1031.SelectedIndex = 0;
     comboBox1032.SelectedIndex = 0;
     comboBox1033.SelectedIndex = 0;
     comboBox1034.SelectedIndex = 0;
     comboBox1051.SelectedIndex = 0;
     comboBox1061.SelectedIndex = 0;
     listBox1.SelectedIndex = 0;
     frm.onGetSettingResponse += new FormMain.onGetSettingResponseDelegate(frm_onGetSettingResponse);
 }
Beispiel #5
0
 public FormDeclareList(FormMain frmMain, List<Declare> list)
 {
     InitializeComponent();
     this.SetFormStyle(true, true, true, true);
     fMain = frmMain;
     decList = list;
     foreach(Declare dec in decList)
     {
         ListViewItem item = new ListViewItem(dec.DeclareID.ToString());
         item.SubItems.Add(dec.ReferDate);
         item.SubItems.Add(dec.DeclareContent);
         item.Tag = dec;
         listView1.Items.Add(item);
     }
 }
Beispiel #6
0
 public FormTeam(FormMain fMain, Team team)
 {
     InitializeComponent();
     frmMain = fMain;
     if(team.TeamName == "")
         this.Text = "��ӳ���";
     else textBox1.Enabled = false;
     this.SetFormStyle(false, false, false, false);
     this.temp = team;
     textBox1.Text = team.TeamName;
     textBox2.Text = team.TeamLinkman;
     textBox3.Text = team.TeamTel;
     textBox3.KeyPress += Pub.KeyPress_NumInput;
     textBox4.Text = team.TeamAddress;
     textBox5.Text = team.Password;
     checkBox1.Checked = team.PolicyModCar == 1;
     checkBox2.Checked = team.PolicyOrder == 1;
     checkBox3.Checked = team.PolicyRegion == 1;
     checkBox4.Checked = team.PolicyRegionAlarm == 1;
     frmMain.onModifyTeam += new FormMain.onModifyTeamDelegate(frmMain_onModifyTeam);
 }
Beispiel #7
0
 public FormLogin(FormMain fmain)
 {
     InitializeComponent();
     frmMain = fmain;
     this.SetFormStyle(false, false, false, false);
     foreach(HostConfig lc in Config.LoginList)
         comboBoxhost.Items.Add(lc.Host);
     foreach(UserConfig ur in Config.UserList)
         comboBoxuser.Items.Add(ur.Name);
     comboBoxtype.Items.Add("ϵͳ����Ա");
     comboBoxtype.Items.Add("�ֿع���Ա");
     comboBoxtype.Items.Add("�����û�");
        // comboBoxtype.Items.Add("�����û�");
     comboBoxtype.SelectedIndex = 0;
     if(comboBoxhost.Items.Count > 0)
         comboBoxhost.SelectedIndex = 0;
     if(comboBoxuser.Items.Count > 0)
         comboBoxuser.SelectedIndex = 0;
     frmMain.onConnected += new FormMain.onConnectedDelegate(frmMain_onConnected);
     frmMain.onLogin += new FormMain.onLoginDelegate(frmMain_onLogin);
     frmMain.onDisconn += new FormMain.onDisconnDelegate(frmMain_onDisconn);
 }
Beispiel #8
0
 public void ShowList(FormMain frm)
 {
     mainFrm = frm;
     this.Show();
 }
Beispiel #9
0
 private void button1_Click(object sender, EventArgs e)
 {
     FormMain.C_Alarm_Free(car.CarID.ToString(), checkBox1.Checked ? "1" : "0");
     hasHandle = true;
     this.Close();
 }