public List <MessageModel> ProcessMasterInsertUpdate(FactoryProcessModel process, int Createdby) { FactoryProcessModel processmodel = new FactoryProcessModel(); List <MessageModel> response = new List <MessageModel>(); try { response = _db.Query <MessageModel>("USP_PROCESS_INSERT_UPDATE_DELETE_V2 ", new { ProcessID = process.Processid, ProcessCode = process.Processcode, ProcessName = process.Processname, ProcessDescription = process.ProcessDesc, CreatedBy = Createdby, ModifiedBy = Createdby, Mode = process.FLAG, Active = process.active }, commandType: CommandType.StoredProcedure).ToList(); } catch (Exception ex) { throw ex; } return(response); }
public List <MessageModel> BomInsertUpdate(FactoryProcessModel bom, int CreatedBy) { DataTable dtSequence; DataTable dtInputMaterial; DataTable dtOutputMaterial; DataTable dtFGMaterial; DataTable dtWorkstation; DataTable dtResource; DataTable dtQC; dtSequence = SequenceTypeListDetails(bom.SequenceTypeList); dtInputMaterial = InputMaterialTypeListDetails(bom.InputMaterialTypeList); dtOutputMaterial = OutputMaterialTypeListDetails(bom.OutputMaterialTypeList); dtFGMaterial = FGMaterialTypeListDetails(bom.FGMaterialTypeList); dtWorkstation = WorkstationTypeListDetails(bom.WorkstationTypeList); dtResource = ResourceTypeListDetails(bom.ResourceTypeList); dtQC = QCTypeListDetails(bom.QCTypeList); List <MessageModel> response = new List <MessageModel>(); try { response = _db.Query <MessageModel>("USP_PROCESS_FRAMEWORK_INSERT_UPDATE_V2 ", new { P_PROCESSFRAMEWORKNAME = bom.BomName, P_PROCESSFRAMEWORKCODE = bom.Bomcode, P_PROCESSFRAMEWORKDESCRIPTION = bom.BomDesc, P_PROCESSFRAMEWORKPRODUCT = bom.ProductID, P_CREATEDBY = CreatedBy, P_MODIFIEDBY = CreatedBy, TempTableSequence = dtSequence.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_SEQUENCE"), TempTableInputMaterial = dtInputMaterial.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_INPUT_MATERIAL"), TempTableOutputMaterial = dtOutputMaterial.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_OUTPUT_MATERIAL"), TempTableFGMaterial = dtFGMaterial.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_FG_MATERIAL"), TempTableWorkstation = dtWorkstation.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_WORKSTATION"), TempTableResource = dtResource.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_RESOURCE"), TempTableQC = dtQC.AsTableValuedParameter("Type_PROCESS_FRAMEWORK_QC"), P_FLAG = bom.FLAG, P_PROCESSFRAMEWORKID = bom.Bomid, P_PROCESSID = bom.Processid }, commandType: CommandType.StoredProcedure).ToList(); } catch (Exception ex) { throw ex; } return(response); }