// 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()); }
// 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)); }
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)); }
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()); }
public async Task <int> CreateAsync(MachineTypeModel model) { this.MachineTypeLogic.CreateModel(model); return(await DbContext.SaveChangesAsync()); }