public Result UpdateBatchInfo(AgingBatchInfo batchInfo) { IProduction iProductionSelect = new WCMS_DAL_Production(); var result = new Result(); using ( var transaction = new TransactionScope(TransactionScopeOption.Required, ApplicationState.TransactionOptions)) try { result.IsSuccess = iProductionSelect.UpdateBatchInfo(batchInfo); if (result.IsSuccess) { transaction.Complete(); } else { transaction.Dispose(); } } catch (Exception ex) { throw ex; } return(result); }
public List <AgingBatchInfo> GetAgingBatchData(AgingBatchInfo agingBatchInfo) { try { ISelectingCommon iDataAccessSelect = new DALGetCommonSelecting(); return(iDataAccessSelect.GetAgingBatchData(agingBatchInfo)); } catch (Exception ex) { throw ex; } }
public List <AgingBatchInfo> GetAgingBatchData(AgingBatchInfo agingBatchInfo) { var list = new List <AgingBatchInfo>(); try { list = _CommonManager.GetAgingBatchData(agingBatchInfo); } catch (Exception ex) { } return(list); }
public Result UpdateBatchInfo(AgingBatchInfo batchInfo) { try { return(productionManager.UpdateBatchInfo(batchInfo)); } catch (Exception ex) { return(new Result { IsSuccess = false, Message = ex.Message }); } }
public Result InsertAgingcBatchInfo(AgingBatchInfo agingBatchInfo) { try { return(productionManager.InsertAgingcBatchInfo(agingBatchInfo)); } catch (Exception ex) { return(new Result { IsSuccess = false, Message = ex.Message }); } }
public bool InsertAgingcBatchInfo(AgingBatchInfo agingBatchInfo) { try { _entity.AgingBatchInfo.Add(agingBatchInfo); _entity.SaveChanges(); } catch (Exception ex) { throw ex; } return(true); }
public List <AgingBatchInfo> GetAgingBatchData(AgingBatchInfo agingBatchInfo) { List <AgingBatchInfo> list; try { list = _wcmsEntities.AgingBatchInfo .WhereIf(agingBatchInfo.BatchNo != null, x => x.BatchNo == agingBatchInfo.BatchNo) .WhereIf(agingBatchInfo.Status != null, x => x.Status == agingBatchInfo.Status) .AsNoTracking().ToList(); } catch (Exception ex) { throw ex; } return(list); }
public Result InsertAgingcBatchInfo(AgingBatchInfo agingBatchInfo) { try { IProduction _IProductionInsert = new WCMS_DAL_Production(); using ( var transaction = new TransactionScope(TransactionScopeOption.Required, ApplicationState.TransactionOptions)) { Result _Result = new Result(); _Result.IsSuccess = _IProductionInsert.InsertAgingcBatchInfo(agingBatchInfo); if (_Result.IsSuccess) { transaction.Complete(); } return(_Result); } } catch (Exception ex) { throw ex; } }
public bool UpdateBatchInfo(AgingBatchInfo batchInfo) { _entity.Configuration.LazyLoadingEnabled = false; var batchInfos = _entity.AgingBatchInfo.FirstOrDefault(x => x.BatchNo == batchInfo.BatchNo); if (batchInfos != null) { if (batchInfo.Status != "") { batchInfos.Status = batchInfo.Status.ToUpper(); } if (batchInfo.AgingFailed.HasValue) { batchInfos.AgingFailed = batchInfo.AgingFailed; } if (batchInfo.ChargingFailed.HasValue) { batchInfos.ChargingFailed = batchInfo.ChargingFailed; } _entity.Entry(batchInfos).State = EntityState.Modified; _entity.SaveChanges(); } else { return(false); } return(true); }
public Result InsertAgingBatchQcInfo(List <ProductionMaster> productionAgingQc, string batchStatus, long userId, long lineId, long projectId) { IProduction iProductionSelect = new WCMS_DAL_Production(); IProduction iProductionInsert = new WCMS_DAL_Production(); var result = new Result(); var batchnumber = ""; try { //logic var productionList = new List <ProductionMaster>(); foreach (var items in productionAgingQc) { var production = new ProductionMaster(); var isExists = _isSelectingCommon.ProductionMasterInfo(new ProductionMaster { MobileCode = items.MobileCode }).Any(); //check if previously passed var previousStatus = _isSelectingCommon.ProductionMasterInfo(new ProductionMaster { MobileCode = items.MobileCode }).FirstOrDefault(); //var previousStation = entities.ProductionMaster.FirstOrDefault(a => a.MobileCode == items.MobileCode); //if (previousStatus != null && (isExists && previousStatus.Passed.ToUpper() == "N")) if (previousStatus != null && (isExists && previousStatus.Passed.ToUpper() == "N") && previousStatus.QcStation != "AGQC") { result.Message = " Item Not Passed From Aesthetic QC Station. Item No:" + items.MobileCode + ""; return(result); } //if (previousStatus != null && (isExists && previousStatus.QcStation.Trim() != "ASTQC")) if (previousStatus != null && (isExists) && (previousStatus.QcStation.Trim() != "ASTQC" && previousStatus.QcStation.Trim() != "AGQC") && items.QcStation.Trim() == "AGQC") { result.Message = "Item Not Checked In Aesthetic QC Station. Item No:" + items.MobileCode + ""; return(result); } if (previousStatus == null || !isExists) { result.Message = "Item Not Checked In Aesthetic QC Station. Item No:" + items.MobileCode + ""; return(result); } if (items.QcStation == "AGQC") { production.MobileCode = items.MobileCode; production.QcStation = items.QcStation; production.Passed = items.Passed.ToUpper(); if (items.Passed.ToUpper() == "Y") { production.AgingBatchNumber = items.AgingBatchNumber; } production.AgingBy = userId; production.AgingAD = DateTime.Now; production.Remarks = items.Remarks; batchnumber = items.AgingBatchNumber; productionList.Add(production); } if (productionList.Count == productionAgingQc.Count) { result.IsSuccess = iProductionSelect.InsertAgingBatchQcInfo(productionList); if (result.IsSuccess) { //insert into rework foreach (var failItems in productionList) { if (failItems.Passed.ToUpper() == "N") { production.AgingBatchNumber = ""; var reresult = new Result(); var rework = new tblRework(); rework.ProjectId = projectId; rework.MobileCode = failItems.MobileCode; rework.Issues = failItems.Remarks; rework.FailedStation = failItems.QcStation; rework.Status = "P"; rework.AddedBy = userId; rework.AddedDate = DateTime.Now; reresult.IsSuccess = iProductionInsert.InsertFunctionalRework(rework); } } var batchResults = new Result(); if (result.IsSuccess) { var batchInfo = new AgingBatchInfo(); batchInfo.BatchNo = batchnumber; if (batchStatus.ToUpper() == "N") { batchInfo.Status = "F"; } if (batchStatus.ToUpper() == "Y") { batchInfo.Status = "P"; } batchResults.IsSuccess = iProductionInsert.UpdateBatchInfo(batchInfo); } } } } } catch (Exception ex) { throw ex; } return(result); }