You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Utils;
using VM;
namespace Web.Controllers
{
public class RegLicController : Controller
{
/// <summary>
/// 授权注册界面
/// </summary>
/// <returns></returns>
public ActionResult RegLicense()
{
ViewBag.RequestCode = GTA.License.Register.GetCode();
return View();
}
/// <summary>
/// 注册授权
/// </summary>
/// <param name="licenseCode">授权码</param>
/// <returns></returns>
[HttpPost]
public ActionResult RegLicense(string applyCode,string licenseCode)
{
string productcode = AppSettingsHelper.GetStringByKey("ProductCode", "");
string strMsg = string.Empty;
if (string.IsNullOrEmpty(productcode))
{
strMsg = "软件编号为空!";
}
else if (string.IsNullOrEmpty(applyCode.Trim()))
{
strMsg = "申请码为空!";
}
else if (string.IsNullOrEmpty(licenseCode.Trim()))
{
strMsg = "授权码为空!";
}
else
{
if (GTA.License.Register.Registe(productcode,applyCode, licenseCode))
{
ServerConfig.RegisterState = true;
return Json(new JsonModel(true, string.Empty));
}
}
return Json(new JsonModel(false,"注册失败"));
}
}
}