初始化项目
This commit is contained in:
98
AUTS.Web/Areas/App/Models/Get_Ip_location.cs
Normal file
98
AUTS.Web/Areas/App/Models/Get_Ip_location.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using AUTS.Services.Enums;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
namespace AUTS.Web.Areas.App.Models
|
||||
{
|
||||
public static class Get_Ip_location
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
/// 获取客户端Ip
|
||||
|
||||
/// </summary>
|
||||
|
||||
/// <returns></returns>
|
||||
|
||||
public static String GetClientIp()
|
||||
|
||||
{
|
||||
|
||||
String clientIP = "";
|
||||
|
||||
if (System.Web.HttpContext.Current != null)
|
||||
|
||||
{
|
||||
|
||||
clientIP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
|
||||
|
||||
if (string.IsNullOrEmpty(clientIP) || (clientIP.ToLower() == "unknown"))
|
||||
|
||||
{
|
||||
|
||||
clientIP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_REAL_IP"];
|
||||
|
||||
if (string.IsNullOrEmpty(clientIP))
|
||||
|
||||
{
|
||||
|
||||
clientIP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
clientIP = clientIP.Split(',')[0];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return clientIP;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 百度api
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetBaiduIp(string ip)
|
||||
{
|
||||
string location = "";
|
||||
try
|
||||
{
|
||||
string url = $"https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query={ip}&co=&resource_id=6006&oe=utf8";
|
||||
WebClient client = new WebClient();
|
||||
var buffer = client.DownloadData(url);
|
||||
string jsonText = Encoding.UTF8.GetString(buffer);
|
||||
JObject jo = JObject.Parse(jsonText);
|
||||
|
||||
Root root = JsonConvert.DeserializeObject<Root>(jo.ToString());
|
||||
foreach (var item in root.data)
|
||||
{
|
||||
location = item.location;
|
||||
}
|
||||
return location;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Console.WriteLine(ex);
|
||||
return location;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
28
AUTS.Web/Areas/App/Models/practical.cs
Normal file
28
AUTS.Web/Areas/App/Models/practical.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace AUTS.Web.Areas.App.Models
|
||||
{
|
||||
public static class practical
|
||||
{
|
||||
public static void Purge(ref List<double> needToPurge)
|
||||
{
|
||||
|
||||
for (int i = 0; i < needToPurge.Count - 1; i++)
|
||||
{
|
||||
double deststring = needToPurge[i];
|
||||
for (int j = i + 1; j < needToPurge.Count; j++)
|
||||
{
|
||||
if (deststring.CompareTo(needToPurge[j]) == 0)
|
||||
{
|
||||
needToPurge.RemoveAt(j);
|
||||
j--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
AUTS.Web/Areas/App/Models/showModel.cs
Normal file
39
AUTS.Web/Areas/App/Models/showModel.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using AUTS.Domain.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace AUTS.Web.Areas.App.Models
|
||||
{
|
||||
public class showModel
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public string RepairRequestNum { get; set; }
|
||||
public int ProductID { get; set; }
|
||||
public string Barcode { get; set; }
|
||||
public string ProductImage { get; set; }
|
||||
public string RejectSource { get; set; }
|
||||
public string RejectCode { get; set; }
|
||||
public string RejectDesc { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
public System.DateTime UpdateTime { get; set; }
|
||||
public string RepairProgress { get; set; }
|
||||
public int RepairResult { get; set; }
|
||||
public int RepairLogID { get; set; }
|
||||
public int Repairier { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public string DetailRemark { get; set; }
|
||||
public string ProductlMarking { get; set; }
|
||||
public int Statement { get; set; }
|
||||
|
||||
public int Payer { get; set; }
|
||||
|
||||
public int Storage { get; set; }
|
||||
|
||||
public string Salesman { get; set; }
|
||||
public List<showModel> ziLs { get; set; }
|
||||
public TBL_RepairLog theLog { get; set; }//维修后的数据
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user