Browse Source

看板按ErpSite区分

master
qian 8 months ago
parent
commit
4ead01a2f1
  1. 5
      北京北汽/Controller/SCP_ASK_CONTROLLER.cs
  2. 4
      北京北汽/Controller/SCP_PO_CONTROLLER.cs
  3. 4
      北京北汽/Models/AppBoxEntity/User.cs
  4. 3
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs
  5. 1
      北京北汽/SCP/Views/PlanData/SCP_PO.aspx.cs
  6. 21
      北京北汽/SCP/default_hb.aspx.cs
  7. 2
      北京北汽/SCP/main.aspx.cs

5
北京北汽/Controller/SCP_ASK_CONTROLLER.cs

@ -97,7 +97,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p.CreateUser == p_entity.CreateUser);
}
if (!string.IsNullOrEmpty( p_entity.SubSite))
{
q = q.Where(p => p.SubSite == p_entity.SubSite);
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));

4
北京北汽/Controller/SCP_PO_CONTROLLER.cs

@ -108,6 +108,10 @@ namespace CK.SCP.Controller
{
q = q.Where(p => p_entity.UserInSubSite.Contains(p.SubSite));
}
if (!string.IsNullOrEmpty(p_entity.SubSite))
{
q = q.Where(p => p.SubSite == p_entity.SubSite);
}
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
var _po = db.TB_PO_DETAIL.Where(p => p.PartCode == p_entity.PartCode && p.IsDeleted == false);

4
北京北汽/Models/AppBoxEntity/User.cs

@ -101,6 +101,10 @@ namespace CK.SCP.Models.AppBoxEntity
public List<string> SubSiteList { set; get; }
[NotMapped]
public string UsedDomain { set; get; }
/// <summary>
/// 首页选的地点
/// </summary>
public string UserdSite { set; get; }

3
北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs

@ -178,7 +178,8 @@ namespace SCP.PlanData
_entity.UserInVendIds = CurrentUser.VenderList;
}
_entity.UserInSubSite = CurrentUser.SubSiteList;
//_entity.UserInSubSite = CurrentUser.SubSiteList;
_entity.SubSite = CurrentUser.UserdSite;
SCP_ASK_CONTROLLER.Get_V_TB_ASK_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)

1
北京北汽/SCP/Views/PlanData/SCP_PO.aspx.cs

@ -104,6 +104,7 @@ namespace SCP.PlanData
_entity.UserInVendIds = CurrentUser.VenderList;
_entity.UserInSubSite = CurrentUser.SubSiteList;
_entity.PartCode = TXT_PartCode.Text;
_entity.SubSite = CurrentUser.UserdSite;
SCP_PO_CONTROLLER.Get_V_TB_PO_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)

21
北京北汽/SCP/default_hb.aspx.cs

@ -19,6 +19,7 @@ using CK.SCP.Models.Enums;
using System.Drawing;
using static CK.SCP.Common.MyWebSmtpMail;
using MailKit.Security;
using System.Collections;
namespace SCP
{
@ -48,7 +49,10 @@ namespace SCP
else
{
User user = DB.Users.Where(u => u.Name == _name && u.Email == _mail).FirstOrDefault();
user.UsedDomain = factoryValue.Value;
var _list = SCPDB.TB_FACTORY.ToList();
var erpdomain = _list.FirstOrDefault(q => q.ErpSite == factoryValue.Value).ErpDomain;
user.UsedDomain = erpdomain;
user.UserdSite = factoryValue.Value;
if (user != null)
{
if (!user.Enabled)
@ -87,7 +91,7 @@ namespace SCP
factory.DataTextField = "FactoryName";
factory.DataValueField = "ErpDomain";
factory.DataValueField = "ErpSite";
factory.DataSource = _list;
factory.DataBind();
@ -119,6 +123,7 @@ namespace SCP
}
private void Login(string p_userName, string p_password)
{
var _list = SCPDB.TB_FACTORY.ToList();
if (string.IsNullOrEmpty(textUserName.Value) || string.IsNullOrEmpty(textPassword.Value))
{
Alert.Show(GetResourceKey("用户名或密码不能为空!"));
@ -190,8 +195,15 @@ namespace SCP
}
var _factoryList = DB.Users.Where(itm => itm.Name == user.Name).FirstOrDefault().TA_FACTORY.Select(p => p.FactoryId).ToList();
var fac = DB.TA_FACTORY.Select(p => p.FactoryId).ToList();
user.UsedDomain = factoryValue.Value;
if (_factoryList.Contains(factoryValue.Value))
if (string.IsNullOrEmpty( factoryValue.Value))
{
factoryValue.Value = SCPDB.TB_FACTORY.ToList().FirstOrDefault().ErpSite;
}
var erpdomain = _list.FirstOrDefault(q => q.ErpSite == factoryValue.Value).ErpDomain;
user.UsedDomain = erpdomain;
user.UserdSite = factoryValue.Value;
if (_factoryList.Contains(erpdomain))
{
string date = DateTime.Now.ToShortDateString();
var ret = SCP_LOGINNUMBER_CONTROLLER.Save_TA_LOGINNUMBER(p_userName, LoginNumer.Sussess, date);
@ -296,6 +308,7 @@ namespace SCP
if (first != null)
{
first.Remark = user.UsedDomain;
first.UserdSite = user.UserdSite;
DB.SaveChanges();
}
img.ImageUrl = DrawToBase64(4);

2
北京北汽/SCP/main.aspx.cs

@ -63,7 +63,7 @@ namespace SCP
JObject ids = GetClientIDS(regionPanel, regionTop, mainTabStrip, txtUser,
txtOnlineUserCount, txtCurrentTime, btnRefresh);
ids.Add("userName", GetIdentityName());
var factoryModel = DB.TA_FACTORY.FirstOrDefault(p => p.FactoryId == CurrentUser.UsedDomain);
var factoryModel = DB.TA_FACTORY.FirstOrDefault(p => p.ErpSite == CurrentUser.UserdSite);
ids.Add("userIP", factoryModel != null ? factoryModel.FactoryName : Request.UserHostAddress); //
ids.Add("onlineUserCount", GetOnlineCount());

Loading…
Cancel
Save