コード例 #1
0
        // GET: COPR16_MANCTYPE_MSTR/Create
        public ActionResult Create()
        {
            MachineTypeModel model = new MachineTypeModel(db);

            model.cOPR16_MANCTYPE_MSTR = new COPR16_MANCTYPE_MSTR();
            return(View(model));
        }
 public async Task <int> CreateAsync(MachineTypeModel model)
 {
     do
     {
         model.Code = CodeGenerator.Generate();
     }while (DbSet.Any(d => d.Code.Equals(model.Code)));
     this.MachineTypeLogic.CreateModel(model);
     return(await DbContext.SaveChangesAsync());
 }
コード例 #3
0
        // GET: COPR16_MANCTYPE_MSTR/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            COPR16_MANCTYPE_MSTR cOPR16_MANCTYPE_MSTR = await db.COPR16_MANCTYPE_MSTR.FindAsync(id);

            if (cOPR16_MANCTYPE_MSTR == null)
            {
                return(HttpNotFound());
            }
            MachineTypeModel model = new MachineTypeModel(db);

            model.cOPR16_MANCTYPE_MSTR = cOPR16_MANCTYPE_MSTR;
            return(View(model));
        }
コード例 #4
0
        public ResultObj <List <MachineTypeModel> > GetData(string typeName = "", string typeType = "", int pageIndex = 1, int pageSize = 10)
        {
            // IProduct service = new ProductService();
            //List<ProductModel> products = service.GetAllProducts();

            MachineTypeModel machineTypeInfo = new MachineTypeModel();

            machineTypeInfo.TypeName  = typeName;
            machineTypeInfo.TypeType  = typeType;
            machineTypeInfo.PageIndex = pageIndex;
            machineTypeInfo.PageSize  = pageSize;
            var users      = _IBase.GetAll(machineTypeInfo);
            int totalcount = _IBase.GetCount(machineTypeInfo);

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

            return(Content(users, pagination));
        }
コード例 #5
0
 public ResultObj <int> PutData([FromBody] MachineTypeModel machineTypeInfo)
 {
     return(Content(_IBase.UpdateData(machineTypeInfo)));
 }
        public async Task <int> UpdateAsync(int id, MachineTypeModel model)
        {
            await this.MachineTypeLogic.UpdateModelAsync(id, model);

            return(await DbContext.SaveChangesAsync());
        }
コード例 #7
0
 public async Task <int> CreateAsync(MachineTypeModel model)
 {
     this.MachineTypeLogic.CreateModel(model);
     return(await DbContext.SaveChangesAsync());
 }