Exemplo n.º 1
0
        public List <SysApi> GetAllSysApi()
        {
            SqlCommand cmd = new SqlCommand("dbo.SysApi_GetAllApi");
            var        dt  = _sqlDatabase.ExecuteSelect(cmd);

            List <SysApi> apiList = new List <SysApi>();

            foreach (DataRow row in dt.Rows)
            {
                SysApi api = new SysApi();
                api.Id   = (int)row["SysApiId"];
                api.Name = row["Name"].ToString();
                api.Code = row["Code"].ToString();
                apiList.Add(api);
            }

            return(apiList);
        }
Exemplo n.º 2
0
        public List <Robot> GetAllRobot()
        {
            SqlCommand cmd = new SqlCommand("dbo.Robot_GetAll");

            var dt = _sqlDb.ExecuteSelect(cmd);

            List <Robot> res = new List <Robot>();

            foreach (DataRow row in dt.Rows)
            {
                Robot r = new Robot()
                {
                    Id   = DataTableUtils.GetValue <int>(row, "RobotId"),
                    Code = DataTableUtils.GetValue <string>(row, "Code"),
                    Name = DataTableUtils.GetValue <string>(row, "Name")
                };

                res.Add(r);
            }

            return(res);
        }
        public RobotGridObstacleBehaviourLinkViewModel GetObstacleBehaviourList(string robotCode, string obstacleCode)
        {
            SqlCommand cmd = new SqlCommand("dbo.LinkRobotGridObstacleBehaviour_Get");

            cmd.Parameters.AddWithValue("@RobotCode", robotCode);
            cmd.Parameters.AddWithValue("@GridObstacleCode", obstacleCode);
            var dt = _sqlDb.ExecuteSelect(cmd);


            DataRow row = dt.Rows[0];

            RobotGridObstacleBehaviourLinkViewModel obj = new RobotGridObstacleBehaviourLinkViewModel();

            obj.RobotCode    = DataTableUtils.GetValue <string>(row, "RobotCode");
            obj.ObstacleCode = DataTableUtils.GetValue <string>(row, "ObstacleCode");
            obj.ObstacleName = DataTableUtils.GetValue <string>(row, "ObstacleName");
            obj.ObstacleBehaviourDescription = DataTableUtils.GetValue <string>(row, "ObstacleBehaviourDescription");
            obj.ObstacleBehaviourCode        = DataTableUtils.GetValue <string>(row, "ObstacleBehaviourCode");


            return(obj);
        }
Exemplo n.º 4
0
        public List <EmployeeViewModel> GetEmployeeByPan(List <string> panList)
        {
            SqlCommand cmd = new SqlCommand("dbo.CoreEmployee_GetByPan");

            cmd.Parameters.AddWithValue("@Pan", string.Join(",", panList));
            var dt = _sqlDatabase.ExecuteSelect(cmd);

            List <EmployeeViewModel> empList = new List <EmployeeViewModel>();

            foreach (DataRow row in dt.Rows)
            {
                EmployeeViewModel empModel = new EmployeeViewModel();
                empModel.Id          = DataTableUtils.GetValue <long?>(row, "CoreEmployeeId");
                empModel.Pan         = DataTableUtils.GetValue <string>(row, "Pan");
                empModel.FirstName   = DataTableUtils.GetValue <string>(row, "FirstName");
                empModel.LastName    = DataTableUtils.GetValue <string>(row, "LastName");
                empModel.BirthDate   = DataTableUtils.GetValue <DateTime?>(row, "BirthDate");
                empModel.Description = DataTableUtils.GetValue <string>(row, "Description");

                empList.Add(empModel);
            }

            return(empList);
        }