public void RaiseRequest(CRMData data) { Console.WriteLine("\nNew Request Raised.. Sending Emails.. "); string emailBody = FormatEmail(data); SendMail(emailBody, data); successor?.RaiseRequest(data); }
public void RaiseRequest(CRMData data) { Console.WriteLine("\nNew Request Raised.. Allocate to The Right Department.. "); // Forward to right department switch (data.OrgDept.Name) { case "IT": break; case "SW": break; case "HR": break; } data.CRMStatus = CRMData.Status.Assigned; successor?.RaiseRequest(data); }
/// <summary> /// /// </summary> /// <param name="data"></param> public void RaiseRequest(CRMData data) { Console.WriteLine("\nNew Request Raised.. Insert to Database.. "); data.CRMStatus = CRMData.Status.New; data.DateRaised = DateTime.Now; data.TrackingId = "CRM0x00023" + data.OrgDept.Name + "0058"; try { SqlCommand cmd = new SqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = GetSQLCommand(data); cmd.Connection = connection; connection.Open(); cmd.ExecuteNonQuery(); connection.Close(); } catch (Exception ex) { } successor?.RaiseRequest(data); }