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
{
///
/// 授权注册界面
///
///
public ActionResult RegLicense()
{
ViewBag.RequestCode = GTA.License.Register.GetCode();
return View();
}
///
/// 注册授权
///
/// 授权码
///
[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,"注册失败"));
}
}
}