public ActionResult Edit([Bind(Include = "globalServiceId,name")] GlobalService globalService) { if (ModelState.IsValid) { db.Entry(globalService).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(globalService)); }
public ActionResult Edit([Bind(Include = "bankId,name,branch,street,city,province,country")] Bank bank) { if (ModelState.IsValid) { db.Entry(bank).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bank)); }
public ActionResult Edit([Bind(Include = "organismId,name")] Organism organism) { if (ModelState.IsValid) { db.Entry(organism).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(organism)); }
public ActionResult Edit([Bind(Include = "currencyTypeId,type")] CurrencyType currencyType) { if (ModelState.IsValid) { db.Entry(currencyType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(currencyType)); }
public ActionResult Edit([Bind(Include = "productId,name,description,version")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product)); }
public ActionResult Edit([Bind(Include = "rateId,rate1")] Rate rate) { if (ModelState.IsValid) { db.Entry(rate).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(rate)); }
public ActionResult Edit([Bind(Include = "stageId,name,serviceId,orden")] Stage stage) { if (ModelState.IsValid) { db.Entry(stage).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.serviceId = new SelectList(db.Service, "serviceId", "name", stage.serviceId); return(View(stage)); }
public ActionResult Edit([Bind(Include = "areaId,name,boss,areaEntityId")] Area area) { if (ModelState.IsValid) { db.Entry(area).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.areaEntityId = new SelectList(db.Entity, "entityId", "name", area.areaEntityId); return(View(area)); }
public ActionResult Edit([Bind(Include = "entityId,name,reupCode,identifAbrev,organismId")] Entity entity) { if (ModelState.IsValid) { db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.organismId = new SelectList(db.Organism, "organismId", "name", entity.organismId); return(View(entity)); }
public ActionResult Edit([Bind(Include = "specialistId,name,areaId,ci")] Specialist specialist) { if (ModelState.IsValid) { db.Entry(specialist).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.areaId = new SelectList(db.Area, "areaId", "name", specialist.areaId); return(View(specialist)); }
public ActionResult Edit([Bind(Include = "invoiceId,amount,invoiceProjectDetailsId,projDetailsSpecialistId")] InvoiceProjectDetails invoiceProjectDetails) { if (ModelState.IsValid) { db.Entry(invoiceProjectDetails).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.invoiceId = new SelectList(db.Invoice, "invoiceId", "invoiceNum", invoiceProjectDetails.invoiceId); ViewBag.projDetailsSpecialistId = new SelectList(db.ProjectDetailsSpecialist, "projDetailsSpecialistId", "projDetailsSpecialistId", invoiceProjectDetails.projDetailsSpecialistId); return(View(invoiceProjectDetails)); }
public ActionResult Edit([Bind(Include = "serviceId,name,globalServiceId,rateId")] Service service) { if (ModelState.IsValid) { db.Entry(service).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.globalServiceId = new SelectList(db.GlobalService, "globalServiceId", "name", service.globalServiceId); ViewBag.rateId = new SelectList(db.Rate, "rateId", "rateId", service.rateId); return(View(service)); }
public ActionResult Edit([Bind(Include = "clientId,bankId,currencyTypeId,accountBank1,titular")] AccountBank accountBank) { if (ModelState.IsValid) { db.Entry(accountBank).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.bankId = new SelectList(db.Bank, "bankId", "name", accountBank.bankId); ViewBag.clientId = new SelectList(db.Client, "clientId", "name", accountBank.clientId); ViewBag.currencyTypeId = new SelectList(db.CurrencyType, "currencyTypeId", "type", accountBank.currencyTypeId); return(View(accountBank)); }
public ActionResult Edit( [Bind( Include = "projectId,name,state,areaId,clientId,advancePercent,startDate,endDate,endDateEstimate,totalContracted,totalnvoiced,toInvoiced,productId,modulequantity_,complexity,plannedhours,executedhours,chronogramDeviation,detentionCancellationDate,detentionCancellationCause,detentionCancellationDetails,observation,reprogrammed,reopeningDate,resumed_" )] Project project) { if (ModelState.IsValid) { db.Entry(project).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.areaId = new SelectList(db.Area, "areaId", "name", project.areaId); ViewBag.clientId = project.Client; ViewBag.productId = new SelectList(db.Product, "productId", "name", project.productId); return(View(project)); }
public ActionResult Edit([Bind(Include = "supplementId,number,name,contractId,amount,nom1,nom2,signedClient,productId,serviceId,signedProvider,comitteNumber,comitteDate,expirationDate")] Supplement supplement, int stateC, System.DateTime dateState, string descriptionState, string jsonClient, bool idclient) { if (ModelState.IsValid) { List <StateCSupplement> stateCSupplement = db.StateCSupplement.Where(st => st.supplementId == supplement.supplementId).ToList(); bool found = false; foreach (StateCSupplement stateCs in stateCSupplement) { if (stateCs.stateCId == stateC) { found = true; stateCs.state = true; stateCs.date = dateState; stateCs.description = descriptionState; } else { stateCs.state = false; } } if (!found) { StateCSupplement _stateCSupplement = new StateCSupplement { stateCId = stateC, Supplement = supplement, date = dateState, description = descriptionState, state = true }; db.StateCSupplement.Add(_stateCSupplement); } db.Entry(supplement).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { id = supplement.contractId, idclient = idclient })); } ViewBag.contractId = new SelectList(db.Contract, "contractId", "number", supplement.contractId); ViewBag.productId = new SelectList(db.Product, "productId", "name", supplement.productId); ViewBag.serviceId = new SelectList(db.Service, "serviceId", "name", supplement.serviceId); ViewBag.idclientValue = idclient; return(View(supplement)); }
public ActionResult Edit([Bind(Include = "clientId,dateCreation,name,identifAbrev,reup,street,city,province,telephone,email,agent,agentPosition,organismId,country,isSubject,fatherId,legalPerson")] Client client, int?clientFather, string jsonData) { if (ModelState.IsValid) { if (jsonData != "") { List <AccountBank> accountBankList = db.AccountBank.Where(a => a.clientId == client.clientId).ToList(); if (accountBankList.Any()) { int count = accountBankList.Count; for (int i = 0; i < count; i++) { db.AccountBank.Remove(accountBankList[i]); } db.SaveChanges(); } ICollection <AccountBank> accountBanks = SetJson(jsonData); if (accountBanks.Count > 0) { foreach (AccountBank accountBank in accountBanks) { accountBank.clientId = client.clientId; db.AccountBank.Add(accountBank); } } } if (client.isSubject) { client.fatherId = clientFather; } //if (client.fatherId != clientFather) // client.fatherId = clientFather; db.Entry(client).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.organismId = new SelectList(db.Organism, "organismId", "name", client.organismId); ViewBag.fatherId = new SelectList(db.Client, "fatherId", "name", client.fatherId); return(View(client)); }
public ActionResult Edit([Bind(Include = "contractId,number,signedProvider,nom1,nom2,description,clientId,expirationDate,signedClient,comitteNumber,comitteDate")] Contract contract, int stateC, System.DateTime dateState, string descriptionState, int idClient) { if (ModelState.IsValid) { List <StateContract> stateContracts = db.StateContract.Where(s => s.contractId == contract.contractId).ToList(); bool found = false; foreach (StateContract stateContract in stateContracts) { if (stateContract.stateCId == stateC) { found = true; stateContract.state = true; stateContract.date = dateState; stateContract.description = descriptionState; } else { stateContract.state = false; } } if (!found) { StateContract _stateContract = new StateContract { stateCId = stateC, Contract = contract, date = dateState, description = descriptionState, state = true }; db.StateContract.Add(_stateContract); } //db.SaveChanges(); contract.clientId = idClient; db.Entry(contract).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.clientId = new SelectList(db.Client, "clientId", "name", contract.clientId); return(View(contract)); }