public static WorkerSize rebuildWorkerSize(WorkerSize inWorkerSize) { NomBodyPartSize nbs = rebuildNomBodyPartSize(inWorkerSize.NomBodyPartSize); Worker wk = rebuildWorker(inWorkerSize.Worker); WorkerSize ws = new WorkerSize(inWorkerSize.Id, wk, nbs, inWorkerSize.IsActive); return(ws); }
public ActionResult _Delete_WorkerSizes(string id) { //string workerId = HttpContext.Cache.Get("WorkerId").ToString(); string workerId = Session["WorkerId"].ToString(); WorkerSize sw = workerSizesRepository.Get(System.Int32.Parse(id)); workerSizesRepository.Delete(sw); return(new JsonResult()); }
public ActionResult _Insert_WorkerSizes(string id) { int nomBodyPart = System.Int32.Parse(id); NomBodyPartSize nbps = nomBodyPartSizeRepository.Get(nomBodyPart); //string workerId = HttpContext.Cache.Get("WorkerId").ToString(); string workerId = Session["WorkerId"].ToString(); Worker w = workerRepository.Get(int.Parse(workerId)); WorkerSize sw = new WorkerSize(); sw.Worker = w; sw.NomBodyPartSize = nbps; sw.IsActive = true; workerSizesRepository.SaveOrUpdate(sw); return(new JsonResult()); }
public ActionResult _Update_WorkerSizes(string id, string oldId) { //string workerId = HttpContext.Cache.Get("WorkerId").ToString(); string workerId = Session["WorkerId"].ToString(); Dictionary <string, object> queryParams = new Dictionary <string, object>(); queryParams.Add("Worker.Id", int.Parse(workerId)); queryParams.Add("Id", int.Parse(oldId)); WorkerSize ws = workerSizesRepository.FindOne(queryParams); int nomBodyPart = System.Int32.Parse(id); NomBodyPartSize nbps = nomBodyPartSizeRepository.Get(nomBodyPart); ws.NomBodyPartSize = nbps; workerSizesRepository.SaveOrUpdate(ws); return(new JsonResult()); }
public void UpdateWorkerSize(WorkerSize workerSize) { _myworkContext.Update(workerSize); }
public void AddWorkerSize(WorkerSize workerSize) { _myworkContext.Add(workerSize); }