public VyController(TicketBLL ticketBll, DepartureBLL departureBll, StationBLL stationBll, UserBLL userBll)
 {
     _ticketBll    = ticketBll;
     _departureBll = departureBll;
     _stationBll   = stationBll;
     _userBll      = userBll;
 }
Example #2
0
        public void TestStationBLL()
        {
            StationBLL bll = new StationBLL(new StationsDAL());

            Station station1 = new Station("stationA1", new SensorAddress("aa.bb1"), "description", 3);

            bll.Add(station1);

            bll.Delete(station1);

            Station station2 = new Station("stationB3", new SensorAddress("aa.bb7"), "description", 3);
            Station station3 = new Station("stationB3", new SensorAddress("aa.bb8"), "description", 3);

            bll.Add(station2);
            bll.Modify(station2, station3);

            bll.Delete(station3);
            Station station4 = (Station)bll.GetObjById(station3.Name);

            bll.ExcuteSqlStr("select * from station");

            List <object> list1 = bll.GetAllObjs();

            List <object> list2 = bll.GetObjsBySQL("select * from station", null);

            List <Station> list3 = bll.GetStationsByUser(new User("aa"));
        }
Example #3
0
 public StationForm(Station station)
 {
     _stationService = new StationBLL();
     InitializeComponent();
     this.station = station;
     PopulateForm();
 }
Example #4
0
        private void StationConfig_Load(object sender, EventArgs e)
        {
            StationBLL stationBll = new StationBLL(new StationsDAL());

            oldStations = stationBll.GetStationsByUser(mainFrm.User);

            oldNode = treeView1.Nodes[this.mainFrm.User.Name];

            DisplayStation(oldStations);
        }
Example #5
0
        public VehicleForm()
        {
            _vehicleService = new VehicleBLL();
            InitializeComponent();
            vehicleTypeBll = new VehicleTypeBLL();
            stationBll     = new StationBLL();

            vehicleTypes = vehicleTypeBll.GetAll();
            stations     = stationBll.GetAll();

            cmbVehicleTypeId.DataSource = vehicleTypes;
            cmbStationId.DataSource     = stations;
        }
Example #6
0
        public IncidentListForm()
        {
            _incidentService = new IncidentBLL();
            InitializeComponent();

            stationBll = new StationBLL();
            stations   = stationBll.GetAll();

            vehicleBLL = new VehicleBLL();

            cmbStation.DataSource = stations;
            txtFirstname.Text     = ApplicationCookie.CurrentUser.Name;
            txtLastname.Text      = ApplicationCookie.CurrentUser.Surname;
        }
        public StationResponseForm()
        {
            _stationResponseService = new StationResponseBLL();
            InitializeComponent();
            responseBll    = new ResponseBLL();
            stationBLL     = new StationBLL();
            vehicleTypeBLL = new VehicleTypeBLL();

            responses    = responseBll.GetAll();
            stations     = stationBLL.GetAll();
            vehicleTypes = vehicleTypeBLL.GetAll();

            cmbResponseId.DataSource    = responses;
            cmbStationId.DataSource     = stations;
            cmbVehicleTypeId.DataSource = vehicleTypes;
        }
Example #8
0
        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            string input   = (string)value;
            bool   success = false;

            var stationBLL = new StationBLL();

            if (stationBLL.GetStationFromName(input) != null)
            {
                return(ValidationResult.Success);
            }
            else
            {
                return(new ValidationResult("Stasjonen du har valgt finnes ikke"));
            }
        }
Example #9
0
        public void InitMainFrm()
        {
            this.title.Location = new System.Drawing.Point(this.Width / 2 - this.title.Width / 2, this.menuStrip1.Height);

            if (user != null)
            {
                if (user.Role == 1)
                {
                    this.menuStrip1.Items.Add("用户管理", null, delegate(object sender, EventArgs e)
                    {
                        UserManageFrm usFrm = new UserManageFrm();
                        usFrm.Show();
                    });
                    this.menuStrip1.Items.Add("站点配置", null, (object sender, EventArgs e) => {
                        StationConfigFrm scFrm = new StationConfigFrm(this);
                        scFrm.Show();
                    });
                }

                UiInformationBLL uiBll = new UiInformationBLL(new UiInformationDAL());

                List <UIInfomation> uiInfos = uiBll.GetUiInformationsByUser(user);
                if (uiInfos.Count > 0)
                {
                    this.Text       = uiInfos[0].Caption;
                    this.title.Text = uiInfos[0].Title;
                }

                List <Station> stations = new List <Station>();

                StationBLL stationBLl = new StationBLL(new StationsDAL());

                stations = stationBLl.GetStationsByUser(this.User);

                ShowStation(stations);
            }
        }
Example #10
0
 public StationListForm()
 {
     _stationService = new StationBLL();
     InitializeComponent();
 }
Example #11
0
        // 0人员 1设备
        private void bcpNewConfigCodeSender_Click(object sender, EventArgs e)
        {
            //存入日志
            LogSave.Messages("[FrmSetCodeSender]", LogIDType.UserLogID, "配置标识卡,标识卡名称:" + lbxCodeSender.Text + ",所属人员姓名:" + lbxEmployee.Text + "。");

            if (lbxEmployee.SelectedItem == null)
            {
                string str = rbtnEmp.Checked == true ? "人员" : "设备";
                MessageBox.Show("请选择" + str);
                return;
            }
            if (((ListItem)lbxEmployee.SelectedItem).ID == "0")
            {
                return;
            }
            if (lbxCodeSender.SelectedItem == null)
            {
                MessageBox.Show("请选择" + KJ128NDataBase.HardwareName.Value(KJ128NDataBase.CorpsName.CodeSender));
                return;
            }
            StationBLL s      = new StationBLL();
            string     tmpStr = ((ListItem)lbxCodeSender.SelectedItem).Name;

            if (s.IsNumeric(tmpStr))
            {
                int tmpInt = csbll.addCodeSender_Set(int.Parse(((ListItem)lbxCodeSender.SelectedItem).ID)
                                                     , int.Parse(((ListItem)lbxEmployee.SelectedItem).ID), rbtnEmp.Checked == true ? 0 : 1);

                if (tmpInt > 0)
                {
                    bcpResult.CaptionTitle = "配置成功!";

                    int emp = lbxEmployee.SelectedIndex;
                    int equ = lbxCodeSender.SelectedIndex;

                    lbxEmployee.Items.RemoveAt(emp);
                    lbxCodeSender.Items.RemoveAt(equ);

                    //
                    if (emp < 0)
                    {
                        lbxEmployee.SelectedIndex = -1;
                    }
                    else
                    {
                        if (lbxEmployee.Items.Count > emp + 1)
                        {
                            lbxEmployee.SelectedIndex = emp;
                        }
                        else
                        {
                            lbxEmployee.SelectedIndex = emp - 1;
                        }
                    }

                    if (equ < 0)
                    {
                        lbxCodeSender.SelectedIndex = -1;
                    }
                    else
                    {
                        if (lbxCodeSender.Items.Count > equ + 1)
                        {
                            lbxCodeSender.SelectedIndex = equ;
                        }
                        else
                        {
                            lbxCodeSender.SelectedIndex = equ - 1;
                        }
                    }

                    if (lbxCodeSender.Items.Count == 1)
                    {
                        lbxCodeSender.SelectedIndex = 0;
                    }

                    LoadCodeSenderConfig();           // 重新加载表格数据
                }
            }
            else
            {
                MessageBox.Show(KJ128NDataBase.HardwareName.Value(KJ128NDataBase.CorpsName.CodeSender) + tmpStr.Replace(" ", "") + " 请重新配置");
                // bcpResult.CaptionTitle = tmpStr;
            }
        }
 public AdminController(DepartureBLL departureBll, StationBLL stationBll, LineBLL lineBll)
 {
     _departureBll = departureBll;
     _stationBll   = stationBll;
     _lineBll      = lineBll;
 }