public static string ProcessRfqFormOne(RFQREQViewModel model) { SOURCING_RFQ_REQ _request = new SOURCING_RFQ_REQ(); try { decimal ItemId = ProcessRequest.GetSequence(); using (var context = new Entities()) { _request.MAPPING = model.MAPPING; _request.TEMP_NO = ItemId; _request.RFQ_START_DATE = model.RFQ_START_DATE; _request.RFQ_CLOSE_DATE = model.RFQ_CLOSE_DATE; _request.DELIVERY_ADDRESS = model.DELIVERY_ADDRESS; _request.INITIATOR_ID = model.INITIATOR_ID; _request.INITIATOR_NAME = model.INITIATOR_NAME; _request.STATUS = "Awaiting Vendor Response"; context.SOURCING_RFQ_REQ.Add(_request); context.SaveChanges(); } Common.UpdateSourcingRequestTableWithMappingInfo((decimal)model.MAPPING, ItemId); return(Convert.ToString(ItemId)); } catch (Exception ex) { Logger.Log("Error insert into RFQ-REQ table. Error: " + ex.Message + "------------------------------------------------" + ex.StackTrace, "error"); return(null); } }
internal static string ProcessRFPIndex(ViewModels.RFIRFPComboViewModel model) { SOURCING_RFP_RFI_REQ _Request = new SOURCING_RFP_RFI_REQ(); SOURCING_CONTACTPERSON _Commercial = new SOURCING_CONTACTPERSON(); SOURCING_CONTACTPERSON _Technical = new SOURCING_CONTACTPERSON(); decimal ItemId = ProcessRequest.GetSequence(); try { using (var context = new Entities()) { _Request.TEMP_ID = ItemId; _Request.PRJECT_TITLE = model.Request.PRJECT_TITLE; _Request.INITIATOR_NAME = model.Request.INITIATOR_NAME; _Request.INITIATOR = model.Request.INITIATOR; _Request.INITIATION_DATE = model.Request.INITIATION_DATE; _Request.PROJECT_OBJECTIVE = model.Request.PROJECT_OBJECTIVE; _Request.WORK_SCOPE = model.Request.WORK_SCOPE; _Request.UBN_OVERVIEW = model.Request.UBN_OVERVIEW; _Request.TECHNICAL_PROPOSAL = model.Request.TECHNICAL_PROPOSAL; _Request.ISSUE_DATE = model.Request.ISSUE_DATE; _Request.DUE_DATE = model.Request.DUE_DATE; _Request.DUE_TIME = model.Request.DUE_TIME; _Request.LST_QRY_RECEIPT_DATE = model.Request.LST_QRY_RECEIPT_DATE; _Request.MAPPING = model.Request.MAPPING; _Request.BANK_QRY_RES_DATE = model.Request.BANK_QRY_RES_DATE; _Request.LST_RPF_RECPT_DATE = model.Request.LST_RPF_RECPT_DATE; _Request.STATUS = "Awaiting Vendor Response"; context.SOURCING_RFP_RFI_REQ.Add(_Request); context.SaveChanges(); _Commercial.TEMP_NO = ItemId; _Commercial.NAME = model.Commercial.NAME; _Commercial.DEPARTMENT = model.Commercial.DEPARTMENT; _Commercial.DESIGNATION = model.Commercial.DESIGNATION; _Commercial.TELEPHONE = model.Commercial.TELEPHONE; _Commercial.EMAIL = model.Commercial.EMAIL; _Commercial.CONTACT_TYPE = "Commercial"; _Technical.TEMP_NO = ItemId; _Technical.NAME = model.Technical.NAME; _Technical.DEPARTMENT = model.Technical.DEPARTMENT; _Technical.DESIGNATION = model.Technical.DESIGNATION; _Technical.TELEPHONE = model.Technical.TELEPHONE; _Technical.EMAIL = model.Technical.EMAIL; _Technical.CONTACT_TYPE = "Technical"; Common.SaveChanges(_Commercial); Common.SaveChanges(_Technical); if (model.Request.MAPPING != null) { Common.UpdateSourcingRequestTableWithMappingInfo((decimal)model.Request.MAPPING, ItemId); } string _tempId = Convert.ToString(ItemId); return(_tempId); } } catch (Exception ex) { Logger.Log("Unable to Insert into SOURCING_RFP_RFI_REQ table. Error: " + ex.Message + "------------------------------------------------" + ex.StackTrace, "error"); return(null); } }