public string Get(string id) { string error = ""; try { string text = id; error = "Decode"; text = Crypt.passwordDecrypt(text, "E546C8DF278CD5931069B522E695D4F2"); //error = "Decryption"; //string decrypted = Crypt.Decrypt(text, "E546C8DF278CD5931069B522E695D4F2"); error = "Split"; string[] decr = text.Split(';'); string Key = decr[0]; error = "Get SoftwareID"; int SoftwareID = Convert.ToInt32(decr[1]); string PCNO = decr[2]; string EMAIL = decr[3]; string Phone = decr[4]; string ActivationUser = decr[5]; string IP = decr[6]; string Type = decr[7]; error = "HttpContext GetService"; dbcontext = HttpContext.RequestServices.GetService(typeof(Models.MAXSDBContext)) as Models.MAXSDBContext;; bool a = false; if (Type == "1") { error = "CheckLicense"; a = dbcontext.CheckLicense(Key, SoftwareID, PCNO, EMAIL, Phone, ActivationUser, IP); } if (Type == "2") { error = "Register"; a = dbcontext.Register(Key, SoftwareID, PCNO, EMAIL, Phone, ActivationUser, IP); } return(a.ToString()); } catch (Exception ex) { return(error + " Error:" + ex.Message); } }
public ActivationController(Models.MAXSDBContext dbcontex, ILogger <ActivationController> logger) { dbcontext = dbcontex; _logger = logger; }