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.
60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace TradeManage
|
|
{
|
|
public class Pages : System.Web.UI.Page
|
|
{
|
|
|
|
public Pages()
|
|
{
|
|
//base.Init += new EventHandler(Pages_Init);
|
|
base.Load += new EventHandler(Pages_Load);
|
|
}
|
|
void Pages_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
public static void Login(System.Web.SessionState.HttpSessionState Session)
|
|
{
|
|
if (Session["UserId"] == null) throw new Exception("Session丢失");
|
|
}
|
|
public static UserModel Login2(System.Web.SessionState.HttpSessionState Session)
|
|
{
|
|
if (Session["Login_UserModel"] == null) throw new Exception("Session丢失");
|
|
return (UserModel)Session["Login_UserModel"];
|
|
}
|
|
public static void SaveLog(int UserId, string Title, string LogContent, int InnerId)
|
|
{
|
|
TradeModel.JC_Log Model = new TradeModel.JC_Log();
|
|
Model.InDate = DateTime.Now;
|
|
Model.InUserId = UserId;
|
|
Model.LogContext = LogContent;
|
|
Model.LogType = Title;
|
|
Model.InnerId = InnerId;
|
|
TradeData.BaseService.SaveLog(Model);
|
|
}
|
|
public static bool IsNatural_Number(string str)
|
|
{
|
|
System.Text.RegularExpressions.Regex reg1 = new System.Text.RegularExpressions.Regex(@".*?[\u4E00-\u9FFF]+.*");
|
|
return reg1.IsMatch(str);
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class UserModel
|
|
{
|
|
public int CompanyID { get; set; }
|
|
public int DeptId { get; set; }
|
|
public string Name { get; set; }
|
|
public int UserID { get; set; }
|
|
public string UserType { get; set; }
|
|
public string UserName { get; set; }
|
|
public string PassWord { get; set; }
|
|
public string CompanyName { get; set; }
|
|
public string Duty { get; set; }
|
|
}
|
|
} |