public JsonResult InsertManualProductionLineSetup(tblAssemblyLineSetup assemblyLine) { Dictionary <int, SessionData> IDictionary = SessionData.GetSessionValues(); var userId = (long)IDictionary[2].Id; var result = new Result(); var tblAssemblyLineSetup = new tblAssemblyLineSetup(); try { tblAssemblyLineSetup.AssemblyLineId = assemblyLine.AssemblyLineId; tblAssemblyLineSetup.ProjectId = assemblyLine.ProjectId; tblAssemblyLineSetup.ProjectName = assemblyLine.ProjectName; tblAssemblyLineSetup.ManPower = assemblyLine.ManPower; tblAssemblyLineSetup.IssuedQuantity = assemblyLine.IssuedQuantity; tblAssemblyLineSetup.HourlyTargetQuantity = assemblyLine.HourlyTargetQuantity; tblAssemblyLineSetup.TotalTargetQuantity = assemblyLine.TotalTargetQuantity; tblAssemblyLineSetup.PreviousQuantity = assemblyLine.PreviousQuantity; tblAssemblyLineSetup.AddedBy = (int)userId; tblAssemblyLineSetup.AddedDate = DateTime.Now; result = _adminService.InsertProductionLineSetup(tblAssemblyLineSetup); } catch (Exception) { throw; } return(Json(result)); }
public List <tblAssemblyLineSetup> GetAssemblineInfo(tblAssemblyLineSetup tblAssemblyLineSetup) { try { ISelectingCommon _IDataAccessSelect = new DALGetCommonSelecting(); return(_IDataAccessSelect.GetAssemblineInfo(tblAssemblyLineSetup)); } catch (Exception ex) { throw ex; } }
public JsonResult InsertProductionLineSetup(tblAssemblyLineSetup assemblyLine, List <tblAssemblyLineSetupDetails> assemblyLineSetupDetails) { Dictionary <int, SessionData> IDictionary = SessionData.GetSessionValues(); var userId = (long)IDictionary[2].Id; var result = new Result(); var tblAssemblyLineSetup = new tblAssemblyLineSetup(); try { tblAssemblyLineSetup.AssemblyLineId = assemblyLine.AssemblyLineId; tblAssemblyLineSetup.ProjectId = assemblyLine.ProjectId; tblAssemblyLineSetup.ProjectName = assemblyLine.ProjectName; tblAssemblyLineSetup.ManPower = assemblyLine.ManPower; tblAssemblyLineSetup.IssuedQuantity = assemblyLine.IssuedQuantity; tblAssemblyLineSetup.HourlyTargetQuantity = assemblyLine.HourlyTargetQuantity; tblAssemblyLineSetup.TotalTargetQuantity = assemblyLine.TotalTargetQuantity; tblAssemblyLineSetup.AddedBy = (int)userId; tblAssemblyLineSetup.AddedDate = DateTime.Now; result = _adminService.InsertProductionLineSetup(tblAssemblyLineSetup); if (result.IsSuccess) { var tblAssemblyLineSetupDetails = new tblAssemblyLineSetupDetails(); foreach (var items in assemblyLineSetupDetails) { tblAssemblyLineSetupDetails.LineId = assemblyLine.AssemblyLineId; tblAssemblyLineSetupDetails.ProjectId = items.ProjectId; tblAssemblyLineSetupDetails.ComponentId = items.ComponentId; tblAssemblyLineSetupDetails.ComponentName = items.ComponentName; tblAssemblyLineSetupDetails.RequisitionQuantity = items.RequisitionQuantity; tblAssemblyLineSetupDetails.SubmitQuantity = items.SubmitQuantity; tblAssemblyLineSetupDetails.AddedBy = (int)userId; tblAssemblyLineSetupDetails.AddedDate = DateTime.Now; result = _adminService.InsertProductionLineSetupDetails(tblAssemblyLineSetupDetails); if (result.IsSuccess) { result = _commonService.UpdateComponentRequisitionList(tblAssemblyLineSetupDetails); } } } } catch (Exception) { throw; } return(Json(result)); }
public bool InsertProductionLineSetup(tblAssemblyLineSetup assemblyLine) { try { _entity.tblAssemblyLineSetup.Add(assemblyLine); _entity.SaveChanges(); } catch (Exception ex) { throw ex; } return(true); }
public Result InsertProductionLineSetup(tblAssemblyLineSetup assemblyLine) { try { return(adminManager.InsertProductionLineSetup(assemblyLine)); } catch (Exception ex) { return(new Result { IsSuccess = false, Message = ex.Message }); } }
public List <tblAssemblyLineSetup> GetAssemblineInfo(tblAssemblyLineSetup tblAssemblyLineSetup) { var assemblyLineList = new List <tblAssemblyLineSetup>(); try { assemblyLineList = _CommonManager.GetAssemblineInfo(tblAssemblyLineSetup); } catch (Exception ex) { } return(assemblyLineList); }
public Result InsertProductionLineSetup(tblAssemblyLineSetup assemblyLine) { try { IAdmin iAdmin = new WCMS_DAL_Admin(); using (TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, ApplicationState.TransactionOptions)) { Result _Result = new Result(); _Result.IsSuccess = iAdmin.InsertProductionLineSetup(assemblyLine); if (_Result.IsSuccess) { transaction.Complete(); } return(_Result); } } catch (Exception ex) { throw ex; } }
public List <tblAssemblyLineSetup> GetAssemblineInfo(tblAssemblyLineSetup tblAssemblyLineSetup) { List <tblAssemblyLineSetup> list; try { list = _wcmsEntities.tblAssemblyLineSetup .WhereIf(tblAssemblyLineSetup.ProjectId != null, x => x.ProjectId == tblAssemblyLineSetup.ProjectId) .AsNoTracking().ToList(); } catch (Exception ex) { throw ex; } return(list); }