public int CreateCertifcate(string hostname) { string CertID; int requestID = 0; Certificate cert = new Certificate(); try { CertID = cert.CreateCertifcate(hostname); if (String.Equals(CertID, "Exsits") == true) { return(-2); } if (String.Equals(CertID, "Issued") == true) { return(-3); } if (CertID.Contains("Error") == true) { return(0); } requestID = cert.SubmitRequest(CertID, hostname); return(requestID); } catch (Exception ex) { Database db = new Database(); db.InsertToErrorMessageTable(hostname, requestID, ex.Message, "CreateCertifcateController");//insert Error Message into The Error Table Log In The DataBase Console.Write(ex.Message); return(0); } }
public int CreateCertifcate(string hostname) { string CertID; int requestID; Certificate cert = new Certificate(); try { CertID = cert.createCertifcate(hostname); if (String.Equals(CertID, "Exsits") == true) { return(-2); } if (String.Equals(CertID, "Issued") == true) { return(-3); } if (CertID.Contains("Error") == true) { return(0); } requestID = cert.submitRequest(CertID, hostname); return(requestID); } catch (Exception ex) { Console.Write(ex.Message); return(0); } }