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.
DS7/DSWeb/Areas/MvcShipping/Controllers/IPLimitController.cs

59 lines
1.7 KiB
C#

3 years ago
using System;
using System.Linq;
using System.Web.Mvc;
using DSWeb.MvcShipping.Models.WMSNew;
using DSWeb.MvcShipping.Models.MsStevedores;
using DSWeb.MvcShipping.DAL.WMSNewDAL;
using DSWeb.MvcShipping.DAL.MsAnnounce;
using System.Collections.Generic;
using HcUtility.Comm;
using HcUtility.Core;
using System.Web.Script.Serialization;
using DSWeb.EntityDA;
using System.Data;
using System.Text;
using DSWeb.Areas.CommMng.Models;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DSWeb.Areas.MvcShipping.DAL.Message;
using DSWeb.MvcShipping.DAL.MsSysBillNoSet;
using DSWeb.MvcShipping.DAL.MsCodeFtpSet;
using DSWeb.TruckMng.Comm.Cookie;
using DSWeb.TruckMng.Helper;
using DSWeb.TruckMng.Helper.Repository;
namespace DSWeb.MvcShipping.Controllers
{
public class IPLimitController : Controller
{
//
// GET:
public ActionResult Index ( )
{
return View();
}
//
public string UpdateIPAddress (string name)
{
//ip更新状态
string message = "0";
try
{
string delsql = "delete from sys_iplimit where oper = '" + name + "'";
Database db = DatabaseFactory.CreateDatabase();
db.ExecuteNonQuery(CommandType.Text, delsql);
string clientIP = System.Web.HttpContext.Current.Request.UserHostAddress;
string inssql = "insert into sys_iplimit (ip,oper) values('" + clientIP + "','" + name + "')";
int rst = db.ExecuteNonQuery(CommandType.Text, inssql);
message=rst>0?"1":"0";
}
catch (Exception)
{
message = "0";
}
return message;
}
}
}