private CrmtMsg addNewOrderMessageByJobID(int nJobID, DataService ds) { CrmtMsg mMsg = new CrmtMsg() { gID = Guid.NewGuid(), nJobID = nJobID, sTitle = "CRM", sMessage = "己有新Order委派, 請按此信息查看", sMessageType = "CREATE" }; ds.CrmtMsg.Add(mMsg); return mMsg; }
private void addMsgRecipientByMsgIDUserIDs(CrmtMsg crmtMsg, List<int> nUserIDs, DataService ds) { for (int i = 0; i < nUserIDs.Count; i++) { CrmtMsgRecipient msgRecipient = new CrmtMsgRecipient() { gID = Guid.NewGuid(), gMsgID = crmtMsg.gID, nUserID = nUserIDs.ElementAt(i), bSent = false }; ds.CrmtMsgRecipient.Add(msgRecipient); } }
private void addMsgRecipientByMsgIDUserIDs(int nJobID, CrmtMsg crmtMsg, List<int> nUserIDs, DataService ds) { CrmtJob crmtJob = ds.CrmtJob.GetAllNotDelete().Where(x => x.nID == nJobID).FirstOrDefault(); if (crmtJob != null) { for (int i = 0; i < nUserIDs.Count; i++) { CrmtMsgRecipient msgRecipient = new CrmtMsgRecipient() { gID = Guid.NewGuid(), gMsgID = crmtMsg.gID, nUserID = nUserIDs.ElementAt(i), bSent = false }; ds.CrmtMsgRecipient.Add(msgRecipient); } } }
private void addMsgRecipientByMsgID(int nJobID, CrmtMsg crmtMsg, DataService ds) { CrmtJob crmtJob = ds.CrmtJob.GetAllNotDelete().Where(x => x.nID == nJobID).FirstOrDefault(); if (crmtJob != null) { List<int> userIDList = new List<int>(); if (crmtJob.nTechnician1ID != null) userIDList.Add(crmtJob.nTechnician1ID.Value); if (crmtJob.nTechnician2ID != null) userIDList.Add(crmtJob.nTechnician2ID.Value); if (crmtJob.nTechnician3ID != null) userIDList.Add(crmtJob.nTechnician3ID.Value); if (crmtJob.nTechnician4ID != null) userIDList.Add(crmtJob.nTechnician4ID.Value); if (crmtJob.nAdHocTechnicianID != null) userIDList.Add(crmtJob.nAdHocTechnicianID.Value); for (int i = 0; i < userIDList.Count; i++) { CrmtMsgRecipient msgRecipient = new CrmtMsgRecipient() { gID = Guid.NewGuid(), gMsgID = crmtMsg.gID, nUserID = userIDList.ElementAt(i), bSent = false }; ds.CrmtMsgRecipient.Add(msgRecipient); } } }
private CrmtMsg addModifyOrderMessageByJobID(int nJobID, DataService ds) { CrmtMsg mMsg = new CrmtMsg() { gID = Guid.NewGuid(), nJobID = nJobID, sTitle = "CRM", sMessage = "現有Order被修改, 請按此信息查看", sMessageType = "MODIFY" }; ds.CrmtMsg.Add(mMsg); return mMsg; }
private CrmtMsg addCancelOrderMessageByJobID(int nJobID, String sCustomerCode, String sCustomerName, DateTime? dRepairDate, DataService ds) { String repairDate = dRepairDate.HasValue ? dRepairDate.Value.ToString("yyyy-MM-ddTHH:mm:ss") : String.Empty; CrmtMsg mMsg = new CrmtMsg() { gID = Guid.NewGuid(), nJobID = nJobID, sTitle = "CRM", sMessage = "被委派的Order: " + nJobID + ", 客戶: " + sCustomerName + ", 日期: " + repairDate + " 己被刪除, 請按此信息刪除手機Order", sMessageType = "CANCEL" }; ds.CrmtMsg.Add(mMsg); return mMsg; }