Browse Source

北汽 添加采购收货地点对应

master
qian 8 months ago
parent
commit
74aab6f120
  1. 1
      北京北汽/Controller/CK.SCP.Controller.csproj
  2. 23
      北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs
  3. 9
      北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs
  4. 228
      北京北汽/Controller/SCP_TB_ADDRESS_BUYER_CONTROLLER.cs
  5. 2
      北京北汽/Models/CK.SCP.Models.csproj
  6. 2
      北京北汽/Models/ScpEntities.cs
  7. 9
      北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ADDRESS_BUYER_EXPORT.cs
  8. 25
      北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PRICE_Update_EXPORT.cs
  9. 29
      北京北汽/Models/ScpEntity/TB_ADDRESS_BUYER.cs
  10. 8
      北京北汽/SCP/SCP.csproj
  11. 8
      北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx
  12. 5
      北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx.cs
  13. 48
      北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx
  14. 191
      北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.cs
  15. 116
      北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.designer.cs
  16. 34
      北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs
  17. 2
      北京北汽/SCP/Views/PlanData/SCP_PO_ASK.aspx
  18. 2
      北京北汽/SCP/Views/PlanData/SCP_PO_CQ.aspx
  19. 13
      北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx
  20. 36
      北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs
  21. 16
      北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs

1
北京北汽/Controller/CK.SCP.Controller.csproj

@ -84,6 +84,7 @@
<Compile Include="SCP_QUALITY_CONTROLLER.cs" /> <Compile Include="SCP_QUALITY_CONTROLLER.cs" />
<Compile Include="SCP_REPORT_CONTROLLER.cs" /> <Compile Include="SCP_REPORT_CONTROLLER.cs" />
<Compile Include="SCP_TB_PRICE_CONTROLLER.cs" /> <Compile Include="SCP_TB_PRICE_CONTROLLER.cs" />
<Compile Include="SCP_TB_ADDRESS_BUYER_CONTROLLER.cs" />
<Compile Include="SCP_TES_PURCHASE_PRICE.cs" /> <Compile Include="SCP_TES_PURCHASE_PRICE.cs" />
<Compile Include="SCP_WMS_CONTROLLER.cs" /> <Compile Include="SCP_WMS_CONTROLLER.cs" />
<Compile Include="SCP_BARCODE_CONTROLLER.cs" /> <Compile Include="SCP_BARCODE_CONTROLLER.cs" />

23
北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs

@ -16,6 +16,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Transactions; using System.Transactions;
using System.Data.Entity.Core; using System.Data.Entity.Core;
using System.Security.Cryptography;
//using WebSrvAPITest; //using WebSrvAPITest;
namespace CK.SCP.Controller namespace CK.SCP.Controller
@ -26,6 +27,25 @@ namespace CK.SCP.Controller
{ {
} }
/// <summary>
/// 随机密码
/// </summary>
/// <returns></returns>
public static string GenerateComplexPassword()
{
int length = 12;
StringBuilder password = new StringBuilder(length);
Random random = new Random();
for (int i = 0; i < length; i++)
{
int a = random.Next(0, 89);
password.Append((char)(a + '!'));
}
return password.ToString();
}
public static ResultObject<List<TEA_SUBSCRIBE>> Get_TEA_SUBSCRIBE_List(TEA_SUBSCRIBE p_entity) public static ResultObject<List<TEA_SUBSCRIBE>> Get_TEA_SUBSCRIBE_List(TEA_SUBSCRIBE p_entity)
{ {
ResultObject<List<TEA_SUBSCRIBE>> _ret = new ResultObject<List<TEA_SUBSCRIBE>>(); ResultObject<List<TEA_SUBSCRIBE>> _ret = new ResultObject<List<TEA_SUBSCRIBE>>();
@ -2063,7 +2083,8 @@ namespace CK.SCP.Controller
User _entity = new User(); User _entity = new User();
_entity.Name = vendname; _entity.Name = vendname;
_entity.Remark = _supplier.Site.ToUpper(); _entity.Remark = _supplier.Site.ToUpper();
_entity.Password = PasswordUtil.CreateDbPassword("99999999"); // 随机密码
_entity.Password = GenerateComplexPassword(); //PasswordUtil.CreateDbPassword("99999999");
_entity.ChineseName = _supplier.VendName; _entity.ChineseName = _supplier.VendName;
_entity.Email = _supplier.VendId + "@163.com"; _entity.Email = _supplier.VendId + "@163.com";
_entity.Gender = "男"; _entity.Gender = "男";

9
北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs

@ -145,6 +145,15 @@ namespace CK.SCP.Controller
} }
else else
{ {
var cou = _lst.Select(q => q.).Count();
var cou1 = _lst.Select(q => q.).Distinct().Count();
if (cou != cou1)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.Add("收货地址重复!");
_ret.Result = false;
return _ret;
}
_lst.ForEach(p => _lst.ForEach(p =>
{ {

228
北京北汽/Controller/SCP_TB_ADDRESS_BUYER_CONTROLLER.cs

@ -0,0 +1,228 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CK.SCP.Models;
using CK.SCP.Models.ScpEntity;
using System.Data.Entity.Migrations;
using CK.SCP.Utils;
using CK.SCP.Models.Enums;
using System.Data.Entity.Core;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Models.AppBoxEntity;
using System.Collections;
namespace CK.SCP.Controller
{
/// <summary>
/// 采购对应收货管理地址
/// </summary>
public class SCP_TB_ADDRESS_BUYER_CONTROLLER
{
/// <summary>
/// 获取采购收货地址对应关系
/// </summary>
/// <param name="Buyer">采购</param>
/// <param name="p_action"></param>
public static void GetTbAddressBuyerList(string Buyer, Action<ResultObject<IQueryable<TB_ADDRESS_BUYER>>> p_action)
{
ResultObject<IQueryable<TB_ADDRESS_BUYER>> _ret = new ResultObject<IQueryable<TB_ADDRESS_BUYER>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<TB_ADDRESS_BUYER> q = db.TB_ADDRESS_BUYER;
if (!string.IsNullOrEmpty(Buyer))
{
q = q.Where(p => p.Buyer.Contains(Buyer));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
if (e.InnerException != null)
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_ADDRESS_BUYER_CONTROLLER), "GetTbAddressBuyerList(Exception)", LogHelper.GetExceptionMessage(e).Message);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_ADDRESS_BUYER_CONTROLLER), "GetTbAddressBuyerList", e.Message);
throw e;
}
}
/// <summary>
/// 导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_ADRESS_BUYER_LIST(List<SCP_ADDRESS_BUYER_EXPORT> p_order_list, string p_creator)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
var _lst = p_order_list;
List<long> uidList = db.TB_ADDRESS.Select(q => q.UID).ToList();
/// 校验
lineError = Checked(p_order_list, uidList);
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(lineError);
_ret.Result = false;
}
else
{
DateTime time = DateTime.Now;
_lst.ForEach(p =>
{
var _Sitelist = db.TB_ADDRESS_BUYER.Count(t => t.Buyer == p.);
if (_Sitelist == 0)
{
TB_ADDRESS_BUYER buyer = new TB_ADDRESS_BUYER();
buyer.AddressUID = long.Parse(p.ID);
buyer.Buyer = p.;
buyer.Creator = p_creator;
buyer.CreateTime = time;
db.TB_ADDRESS_BUYER.Add(buyer);
}
else if (_Sitelist == 1)
{
var buyer = db.TB_ADDRESS_BUYER.SingleOrDefault(t => t.Buyer == p.);
buyer.AddressUID = long.Parse(p.ID);
buyer.UpdateTime = time;
buyer.UpdateUser = p_creator;
db.TB_ADDRESS_BUYER.AddOrUpdate(a => a.UID, buyer);
}
});
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_ADDRESS_BUYER_CONTROLLER), "EXCEL_ADRESS_BUYER_LIST", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
/// <summary>
/// 校验 查看是否有错误
/// </summary>
/// <param name="p_order_list">导入文件</param>
/// <param name="ulist">地址uidlist</param>
/// <returns></returns>
public static List<string> Checked(List<SCP_ADDRESS_BUYER_EXPORT> p_order_list, List<long> ulist)
{
List<string> errorlist = new List<string>();
List<string> userName = new List<string>();
using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance())
{
List<User> users = db.Users.ToList();
//users = users.Where(q => q.Roles.Select(itm => itm.ID).Contains(8)).ToList();
userName = users.Select(q => q.Name).ToList();
}
long ID;
foreach (var item in p_order_list)
{
var count = p_order_list.Where(q => q. == item.).Count();
if (count > 1)
{
errorlist.Add(String.Format("{0}重复", item.));
break;
}
if (!userName.Contains(item.))
{
errorlist.Add(string.Format("{0}不是当前系统人员", item.));
break;
}
if (!long.TryParse(item.ID, out ID))
{
errorlist.Add(string.Format("{0}不能转化为数字", item.ID));
break;
}
else if (!ulist.Contains(ID))
{
errorlist.Add(string.Format("{0}不在收货信息管理(重庆专用)的UID里", item.ID));
break;
}
}
return errorlist;
}
/// <summary>
/// 删除
/// </summary>
/// <param name="uidlist">uid列表</param>
/// <returns></returns>
public static ResultObject<bool> DeleteByUid(List<long> uidlist)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var list = db.TB_ADDRESS_BUYER.Where(itm => uidlist.Contains(itm.UID));
db.TB_ADDRESS_BUYER.RemoveRange(list);
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_TB_ADDRESS_BUYER_CONTROLLER), "DeleteByUid", e.Message); throw e;
}
return _ret;
}
}
}

2
北京北汽/Models/CK.SCP.Models.csproj

@ -344,6 +344,7 @@
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PO_REPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_PO_REPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_ADDRESS_BUYER_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_PART_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelImportEntity\SCP_ASN_EXCEL.cs" /> <Compile Include="ScpEntity\ExcelImportEntity\SCP_ASN_EXCEL.cs" />
@ -351,6 +352,7 @@
<Compile Include="ScpEntity\TA_LOGINNUMBER.cs" /> <Compile Include="ScpEntity\TA_LOGINNUMBER.cs" />
<Compile Include="ScpEntity\TA_MoldSharing.cs" /> <Compile Include="ScpEntity\TA_MoldSharing.cs" />
<Compile Include="ScpEntity\TA_MOLDSHARING_INVOICE.cs" /> <Compile Include="ScpEntity\TA_MOLDSHARING_INVOICE.cs" />
<Compile Include="ScpEntity\TB_ADDRESS_BUYER.cs" />
<Compile Include="ScpEntity\TB_ADDRESS.cs" /> <Compile Include="ScpEntity\TB_ADDRESS.cs" />
<Compile Include="ScpEntity\TB_Code.cs" /> <Compile Include="ScpEntity\TB_Code.cs" />
<Compile Include="ScpEntity\TB_PALLETS.cs" /> <Compile Include="ScpEntity\TB_PALLETS.cs" />

2
北京北汽/Models/ScpEntities.cs

@ -165,6 +165,8 @@ namespace CK.SCP.Models
public virtual DbSet<V_TB_ASK_DETAIL_PO> V_TB_ASK_DETAIL_PO { get; set; } public virtual DbSet<V_TB_ASK_DETAIL_PO> V_TB_ASK_DETAIL_PO { get; set; }
public virtual DbSet<TB_ADDRESS_BUYER> TB_ADDRESS_BUYER { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder) protected override void OnModelCreating(DbModelBuilder modelBuilder)
{ {
modelBuilder.Entity<TA_REVICE_PORT>() modelBuilder.Entity<TA_REVICE_PORT>()

9
北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ADDRESS_BUYER_EXPORT.cs

@ -0,0 +1,9 @@
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_ADDRESS_BUYER_EXPORT
{
public string ID { get; set; }
public string { get; set; }
}
}

25
北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PRICE_Update_EXPORT.cs

@ -0,0 +1,25 @@
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_PRICE_Update_EXPORT
{
public string UID { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
}

29
北京北汽/Models/ScpEntity/TB_ADDRESS_BUYER.cs

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity
{
public partial class TB_ADDRESS_BUYER
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
[Column(Order = 0)]
public long UID { get; set; }
public long AddressUID { get; set; }
[Key]
[Column(Order = 1)]
public string Buyer { get; set; }
[NotMapped]
public string Address { get; set; }
public string Creator { get; set; }
public DateTime? CreateTime { get; set; }
public string UpdateUser { get; set; }
public DateTime? UpdateTime { get; set; }
}
}

8
北京北汽/SCP/SCP.csproj

@ -275,6 +275,7 @@
<Content Include="Views\BasicData\SCP_PRICE_TemporaryPrice.aspx" /> <Content Include="Views\BasicData\SCP_PRICE_TemporaryPrice.aspx" />
<Content Include="Views\BasicData\SCP_RECIVE_PORT.aspx" /> <Content Include="Views\BasicData\SCP_RECIVE_PORT.aspx" />
<Content Include="Views\BasicData\SCP_TA_VEND_PART.aspx" /> <Content Include="Views\BasicData\SCP_TA_VEND_PART.aspx" />
<Content Include="Views\BasicData\SCP_TB_Address_Buyer.aspx" />
<Content Include="Views\BasicData\SCP_TB_Address.aspx" /> <Content Include="Views\BasicData\SCP_TB_Address.aspx" />
<Content Include="Views\BasicData\SCP_VenderUser.aspx" /> <Content Include="Views\BasicData\SCP_VenderUser.aspx" />
<Content Include="Views\BasicData\Supplier.aspx" /> <Content Include="Views\BasicData\Supplier.aspx" />
@ -5134,6 +5135,13 @@
<Compile Include="Views\BasicData\SCP_TA_VEND_PART.aspx.designer.cs"> <Compile Include="Views\BasicData\SCP_TA_VEND_PART.aspx.designer.cs">
<DependentUpon>SCP_TA_VEND_PART.aspx</DependentUpon> <DependentUpon>SCP_TA_VEND_PART.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\BasicData\SCP_TB_Address_Buyer.aspx.cs">
<DependentUpon>SCP_TB_Address_Buyer.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\BasicData\SCP_TB_Address_Buyer.aspx.designer.cs">
<DependentUpon>SCP_TB_Address_Buyer.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_TB_Address.aspx.cs"> <Compile Include="Views\BasicData\SCP_TB_Address.aspx.cs">
<DependentUpon>SCP_TB_Address.aspx</DependentUpon> <DependentUpon>SCP_TB_Address.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

8
北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx

@ -32,12 +32,12 @@
ShowHeader="False" ShowHeader="False"
AllowPaging="True" PageSize="50" OnPageIndexChange="Grid1_OnPageIndexChange" AllowPaging="True" PageSize="50" OnPageIndexChange="Grid1_OnPageIndexChange"
ShowBorder="False" ShowBorder="False"
DataKeyNames ="UID,Site,Name,Subsite,Phone" AllowSorting="true" IsDatabasePaging="true" SortField="Address" > DataKeyNames ="UID,NamePhone,Address" AllowSorting="true" IsDatabasePaging="true" SortField="UID" >
<Columns> <Columns>
<f:BoundField SortField="UID" DataField="UID" HeaderText="UID" ColumnID="UID" />
<f:BoundField SortField="Address" DataField="Address" HeaderText="收货地址" ColumnID="Address" Width="300px"/>
<f:BoundField SortField="Subsite" DataField="Address" HeaderText="收货地址" ColumnID="Address" Width="300px"/> <f:BoundField SortField="NamePone" DataField="NamePone" HeaderText="收货人信息" ColumnID="NamePone" Width="200px"/>
<f:BoundField SortField="Site" DataField="NamePone" HeaderText="收货人信息" ColumnID="NamePone" Width="200px"/>
</Columns> </Columns>
</f:Grid> </f:Grid>

5
北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx.cs

@ -121,6 +121,11 @@ namespace SCP.Views.BasicData
_dt = ExcelHelper.GetDataTableOfXlsx(_stream); _dt = ExcelHelper.GetDataTableOfXlsx(_stream);
} }
var list = ConvertHelper.ToList<SCP_VENDER_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList(); var list = ConvertHelper.ToList<SCP_VENDER_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
if (list.Count == 0)
{
Alert.Show("文件内容为空!");
return;
}
var ret = SCP_TA_LANGUAGE_CONTROLLER.EXCEL_ADRESS_LIST_CQ(list, CurrentUser.FactoryList[0], CurrentUser.Name); var ret = SCP_TA_LANGUAGE_CONTROLLER.EXCEL_ADRESS_LIST_CQ(list, CurrentUser.FactoryList[0], CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true) if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{ {

48
北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx

@ -0,0 +1,48 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_TB_Address_Buyer.aspx.cs" Inherits="SCP.Views.BasicData.SCP_TB_Address_Buyer" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True" Layout="VBox">
<Items>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="Button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="Delete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否确定要删除?'))return false;"></f:Button>
<f:TextBox ID="txtBuyer" runat="server" Label="采购员" Text="">
</f:TextBox>
<f:Button ID="btnSearch" runat="server" Text="快速查找" OnClick="btnSearch_Click" Icon="SystemSearch">
</f:Button>
<f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择导入模板" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click">
</f:Button>
</Items>
</f:Toolbar>
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="true" BoxFlex="1"
ShowHeader="False"
AllowPaging="True" PageSize="50" OnPageIndexChange="Grid1_OnPageIndexChange"
ShowBorder="False"
DataKeyNames="UID" AllowSorting="true" IsDatabasePaging="true" SortField="UID">
<Columns>
<f:BoundField DataField="AddressUID" HeaderText="收货地址UID" ColumnID="AddressUID" />
<f:BoundField DataField="Address" HeaderText="收货地址" ColumnID="Address" Width="300px" />
<f:BoundField DataField="Buyer" HeaderText="采购" ColumnID="Buyer"/>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

191
北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.cs

@ -0,0 +1,191 @@
using CK.SCP.Controller;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Views.BasicData
{
public partial class SCP_TB_Address_Buyer : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (CurrentUser.ID != 0)
{
//读取 所有菜单列表
var mlist = GetMenus(CurrentUser.ID);
if (mlist.Count > 0 && mlist.Contains("收货信息管理(重庆专用)"))
{
BindData();
TranslatorAgent(Grid1);
TranslatorAgents(Toolbar1);
}
else
{
Response.Write("当前用户没有操作该页面权限");
Response.End();
return;
}
}
else
{
Response.Write("当前用户没有操作该页面权限");
Response.End();
return;
}
}
}
public void BindData()
{
SearchADDRESS_BUYER(txtBuyer.Text, (rs) =>
{
var list1 = SortAndPage<TB_ADDRESS_BUYER>(rs, Grid1);
var count1 = list1.ToList().Count;
if (count1 > 0)
{
var _ls1 = list1.ToList();
_ls1.ForEach(p =>
{
var address = SCPDB.TB_ADDRESS.Where(itm => itm.UID == p.AddressUID).FirstOrDefault();
if (address != null)
{
p.Address = address.Address;
}
});
Grid1.DataSource = _ls1;
Grid1.DataBind();
}
else
{
Grid1.DataSource = list1;
Grid1.DataBind();
}
});
}
public void SearchADDRESS_BUYER(string Buyer, Action<IQueryable<TB_ADDRESS_BUYER>> p_action)
{
SCP_TB_ADDRESS_BUYER_CONTROLLER.GetTbAddressBuyerList(Buyer, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
//查询
protected void btnSearch_OnClick(object sender, EventArgs e)
{
BindData();
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
BindData();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
/// <summary>
/// 上传文件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click(object sender, EventArgs e)
{
string _fileName = FileUp.FileName;
if (string.IsNullOrEmpty(_fileName))
{
Alert.Show("选择文件为空!");
return;
}
string _lx = _fileName.Split('.')[1];
Stream _stream = FileUp.PostedFile.InputStream;
DataTable _dt = new DataTable();
if (_lx == "xls")
{
_dt = ExcelHelper.GetDataTable(_stream);
}
else
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
var list = ConvertHelper.ToList<SCP_ADDRESS_BUYER_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
if (list.Count == 0)
{
Alert.Show("文件内容为空!");
return;
}
var ret = SCP_TB_ADDRESS_BUYER_CONTROLLER.EXCEL_ADRESS_BUYER_LIST(list, CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
Alert.Show("导入成功");
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] selections = Grid1.SelectedRowIndexArray;
if (selections.Count() == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!"));
return;
}
List<long> uidlist = new List<long>();
foreach (int rowIndex in selections)
{
uidlist.Add( long.Parse( Grid1.DataKeys[rowIndex][0].ToString()));
}
var ret = SCP_TB_ADDRESS_BUYER_CONTROLLER.DeleteByUid(uidlist);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
Alert.Show(GetResourceKey("删除成功!"));
return;
}
else
{
if (ret.MessageList.Count > 0)
{
Alert.Show(GetResourceKey(string.Join("<br>", ret.MessageList)));
return;
}
else
{
Alert.Show(GetResourceKey(ret.Message));
}
}
}
}
}

116
北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.designer.cs

@ -0,0 +1,116 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.BasicData
{
public partial class SCP_TB_Address_Buyer
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDelete;
/// <summary>
/// txtBuyer 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtBuyer;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
/// <summary>
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
}
}

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

@ -45,22 +45,24 @@ namespace SCP.PlanData
var _ls = ScpCache.ADRESSList; var _ls = ScpCache.ADRESSList;
DDL_Site.DataSource = _ls; DDL_Site.DataSource = _ls;
DDL_Site.DataBind(); DDL_Site.DataBind();
List<string> stinglist = new List<string>(); var name = CurrentUser.Name.ToString();
var list = _ls.Select(q => q.NamePone).ToList(); var buyer = SCPDB.TB_ADDRESS_BUYER.FirstOrDefault(q => q.Buyer == name);
if (list != null) //List<string> stinglist = new List<string>();
{ //var list = _ls.Select(q => q.NamePone).ToList();
list.ForEach(q => //if (list != null)
{ //{
if (q.Contains(' ')) // list.ForEach(q =>
{ // {
stinglist.Add(q.Substring(0, q.IndexOf(' '))); // if (q.Contains(' '))
} // {
// stinglist.Add(q.Substring(0, q.IndexOf(' ')));
}); // }
}
if (stinglist != null) // });
{ //}
DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1 ? 0 : stinglist.IndexOf(CurrentUser.ChineseName); if (buyer != null)
{
DDL_Site.SelectedIndex = _ls.IndexOf( _ls.FirstOrDefault(q=> q.UID == buyer.AddressUID));
} }
} }
public void LoadData() public void LoadData()

2
北京北汽/SCP/Views/PlanData/SCP_PO_ASK.aspx

@ -130,7 +130,7 @@
</f:Grid> </f:Grid>
</Items> </Items>
</f:Panel> </f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="950px" AutoScroll="True" OnClose="Window1_Close" <f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1200px" AutoScroll="True" OnClose="Window1_Close"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" /> IFrameUrl="about:blank" />
<f:Window ID="WindowUpload" runat="server" Hidden="True" <f:Window ID="WindowUpload" runat="server" Hidden="True"

2
北京北汽/SCP/Views/PlanData/SCP_PO_CQ.aspx

@ -198,7 +198,7 @@
</f:Grid> </f:Grid>
</Items> </Items>
</f:Panel> </f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="950px" AutoScroll="True" OnClose="Window1_Close" <f:Window runat="server" ID="Window1" Hidden="True" Height="600px" Width="1200px" AutoScroll="True" OnClose="Window1_Close"
WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true" WindowPosition="Center" IsModal="true" Title="明细详情" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" /> IFrameUrl="about:blank" />
<f:Window ID="WindowUpload" runat="server" Hidden="True" <f:Window ID="WindowUpload" runat="server" Hidden="True"

13
北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx

@ -31,7 +31,7 @@
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
<Items> <Items>
<f:Form runat="server" Title="" Margin="5"> <f:Form runat="server" Title="">
<Items> <Items>
<f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%"> <f:FormRow runat="server" ColumnWidths="25% 25% 25% 25%">
<Items> <Items>
@ -41,13 +41,11 @@
<f:TextBox runat="server" Label="供应商编号" EmptyText="" ID="TXT_VendId" /> <f:TextBox runat="server" Label="供应商编号" EmptyText="" ID="TXT_VendId" />
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server" ColumnWidths="33% 33% 33%"> <f:FormRow runat="server" ColumnWidths="200px 50% 50% 200px ">
<Items> <Items>
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="要货日期" EmptyText="请选择日期" ID="DP_BeginTime" /> <f:DatePicker runat="server" Required="true" DateFormatString="yyyy-MM-dd" Label="要货日期" EmptyText="请选择日期" ID="DP_BeginTime" />
<f:DropDownList runat="server" ID="DDL_Site" Label="送货地址" Hidden="true" DataTextField="Address" DataValueField="Address" Width="200px">
<f:TextBox runat="server" Label="发往地点" EmptyText="" ID="TXT_Site" Hidden="true" />
<f:DropDownList runat="server" ID="DDL_Site" Label="送货地址" Hidden="true" DataTextField="Address" DataValueField="Address">
<%--<f:ListItem Text="重庆市渝北区石香路5号(重庆厂内)" Value="重庆市渝北区石香路5号(重庆厂内)" /> <%--<f:ListItem Text="重庆市渝北区石香路5号(重庆厂内)" Value="重庆市渝北区石香路5号(重庆厂内)" />
<f:ListItem Text="合肥市包河区卧云路68号宝供物流再包装基地" Value="合肥市包河区卧云路68号宝供物流再包装基地"/> <f:ListItem Text="合肥市包河区卧云路68号宝供物流再包装基地" Value="合肥市包河区卧云路68号宝供物流再包装基地"/>
<f:ListItem Text="重庆市渝北区石香路(重庆外库)" Value="重庆市渝北区石香路(重庆外库)" /> <f:ListItem Text="重庆市渝北区石香路(重庆外库)" Value="重庆市渝北区石香路(重庆外库)" />
@ -64,6 +62,11 @@
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox runat="server" Label="发往地点" EmptyText="" ID="TXT_Site" Hidden="true" />
</Items>
</f:FormRow>
</Items> </Items>
</f:Form> </f:Form>

36
北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs

@ -35,23 +35,29 @@ namespace SCP.PlanData
var _ls = ScpCache.ADRESSList; var _ls = ScpCache.ADRESSList;
DDL_Site.DataSource = _ls; DDL_Site.DataSource = _ls;
DDL_Site.DataBind(); DDL_Site.DataBind();
List<string> stinglist = new List<string>(); var name = CurrentUser.Name.ToString();
var list = _ls.Select(q => q.NamePone).ToList(); var buyer = SCPDB.TB_ADDRESS_BUYER.FirstOrDefault(q => q.Buyer == name);
if (list != null) if (buyer != null)
{ {
list.ForEach(q => DDL_Site.SelectedIndex = _ls.IndexOf(_ls.FirstOrDefault(q => q.UID == buyer.AddressUID));
{
if (q.Contains(' '))
{
stinglist.Add(q.Substring(0, q.IndexOf(' ')));
}
});
}
if (stinglist != null)
{
DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1?0: stinglist.IndexOf(CurrentUser.ChineseName);
} }
//List<string> stinglist = new List<string>();
//var list = _ls.Select(q => q.NamePone).ToList();
//if (list != null)
//{
// list.ForEach(q =>
// {
// if (q.Contains(' '))
// {
// stinglist.Add(q.Substring(0, q.IndexOf(' ')));
// }
// });
//}
//if (stinglist != null)
//{
// DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1?0: stinglist.IndexOf(CurrentUser.ChineseName);
//}
} }
private void SetRoleRule() private void SetRoleRule()

16
北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs

@ -114,40 +114,40 @@ namespace SCP.PlanData
protected global::FineUI.DatePicker DP_BeginTime; protected global::FineUI.DatePicker DP_BeginTime;
/// <summary> /// <summary>
/// TXT_Site 控件。 /// DDL_Site 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox TXT_Site; protected global::FineUI.DropDownList DDL_Site;
/// <summary> /// <summary>
/// DDL_Site 控件。 /// txtRemark 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList DDL_Site; protected global::FineUI.TextBox txtRemark;
/// <summary> /// <summary>
/// txtRemark 控件。 /// DatePicker2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.TextBox txtRemark; protected global::FineUI.DatePicker DatePicker2;
/// <summary> /// <summary>
/// DatePicker2 控件。 /// TXT_Site 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.DatePicker DatePicker2; protected global::FineUI.TextBox TXT_Site;
/// <summary> /// <summary>
/// gp1 控件。 /// gp1 控件。

Loading…
Cancel
Save