Exemple #1
0
        // GET: COPR16_MACHINE_MSTR/Create
        public ActionResult Create()
        {
            MachineListModel model = new MachineListModel(db);

            model.cOPR16_MACHINE_MSTR = new COPR16_MACHINE_MSTR();
            return(View(model));
        }
Exemple #2
0
        public int UpdateMachineInlineTime(string machineId)
        {
            MachineListModel machineList = new MachineListModel();

            machineList.MachineId  = machineId;
            machineList.LatestDate = DateTime.Now;

            return(GenerateDal.Update(CommonSqlKey.UpdateMachineInlineTime, machineList));
        }
Exemple #3
0
        public int UpdateMachineInlineTimeAndIpv4(string machineId, int signal, int temp40, int door40, string ipv4)
        {
            MachineListModel machineList = new MachineListModel();

            machineList.MachineId   = machineId;
            machineList.IpV4        = ipv4;
            machineList.Signal      = signal;
            machineList.MachineTemp = Convert.ToDouble(temp40);
            machineList.Door        = door40;
            machineList.LatestDate  = DateTime.Now;

            return(GenerateDal.Update(CommonSqlKey.UpdateMachineInlineTimeAndIpv4, machineList));
        }
        public ResultObj <int> PostData([FromBody] MachineListModel machineListInfo)
        {
            ICommon icommon = new CommonService();
            int     result  = icommon.CheckMachineId(machineListInfo.MachineId, machineListInfo.DeviceId);

            if (result > 0)
            {
                return(Content(0, ResultCode.Fail, "该机器编号已存在"));
            }
            else
            {
                return(Content(_IBase.PostData(machineListInfo)));
            }
        }
Exemple #5
0
        // GET: COPR16_MACHINE_MSTR/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            COPR16_MACHINE_MSTR cOPR16_MACHINE_MSTR = await db.COPR16_MACHINE_MSTR.FindAsync(id);

            if (cOPR16_MACHINE_MSTR == null)
            {
                return(HttpNotFound());
            }
            MachineListModel model = new MachineListModel(db);

            model.cOPR16_MACHINE_MSTR = cOPR16_MACHINE_MSTR;
            return(View(model));
        }
        public ResultObj <List <MachineListModel> > GetData(string machineId = "", string clinetName = "", string userAccount = "", string typeId = "", int pageIndex = 1, int pageSize = 10)
        {
            // IProduct service = new ProductService();
            //List<ProductModel> products = service.GetAllProducts();

            MachineListModel machineListInfo = new MachineListModel();

            machineListInfo.MachineId   = machineId;
            machineListInfo.ClientText  = clinetName;
            machineListInfo.UserAccount = userAccount;
            machineListInfo.TypeId      = typeId;
            machineListInfo.PageIndex   = pageIndex;
            machineListInfo.PageSize    = pageSize;
            var users      = _IBase.GetAll(machineListInfo);
            int totalcount = _IBase.GetCount(machineListInfo);

            var pagination = new Pagination {
                PageSize = pageSize, PageIndex = pageIndex, StartIndex = 0, TotalRows = totalcount, TotalPage = 0
            };

            return(Content(users, pagination));
        }
 public ResultObj <int> PutData([FromBody] MachineListModel machineListInfo)
 {
     return(Content(_IBase.UpdateData(machineListInfo)));
 }