From 74aab6f120837ac4eb2d24437906e7189dd1e5ca Mon Sep 17 00:00:00 2001 From: qian Date: Tue, 26 Mar 2024 09:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E6=B1=BD=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7=E5=9C=B0=E7=82=B9=E5=AF=B9?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/CK.SCP.Controller.csproj | 1 + .../Controller/SCP_DC_UNI_CONTROLLER.cs | 23 +- .../Controller/SCP_TA_LANGUAGE_CONTROLLER.cs | 9 + .../SCP_TB_ADDRESS_BUYER_CONTROLLER.cs | 228 ++++++++++++++++++ 北京北汽/Models/CK.SCP.Models.csproj | 2 + 北京北汽/Models/ScpEntities.cs | 2 + .../SCP_ADDRESS_BUYER_EXPORT.cs | 9 + .../SCP_PRICE_Update_EXPORT.cs | 25 ++ .../Models/ScpEntity/TB_ADDRESS_BUYER.cs | 29 +++ 北京北汽/SCP/SCP.csproj | 8 + .../SCP/Views/BasicData/SCP_TB_Address.aspx | 8 +- .../Views/BasicData/SCP_TB_Address.aspx.cs | 5 + .../Views/BasicData/SCP_TB_Address_Buyer.aspx | 48 ++++ .../BasicData/SCP_TB_Address_Buyer.aspx.cs | 191 +++++++++++++++ .../SCP_TB_Address_Buyer.aspx.designer.cs | 116 +++++++++ .../SCP/Views/PlanData/SCP_ASK.aspx.cs | 34 +-- .../SCP/Views/PlanData/SCP_PO_ASK.aspx | 2 +- .../SCP/Views/PlanData/SCP_PO_CQ.aspx | 2 +- .../SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx | 13 +- .../Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs | 36 +-- .../SCP_PO_CREATE_ASK.aspx.designer.cs | 16 +- 21 files changed, 756 insertions(+), 51 deletions(-) create mode 100644 北京北汽/Controller/SCP_TB_ADDRESS_BUYER_CONTROLLER.cs create mode 100644 北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ADDRESS_BUYER_EXPORT.cs create mode 100644 北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PRICE_Update_EXPORT.cs create mode 100644 北京北汽/Models/ScpEntity/TB_ADDRESS_BUYER.cs create mode 100644 北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx create mode 100644 北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.cs create mode 100644 北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.designer.cs diff --git a/北京北汽/Controller/CK.SCP.Controller.csproj b/北京北汽/Controller/CK.SCP.Controller.csproj index 79556f2..f164940 100644 --- a/北京北汽/Controller/CK.SCP.Controller.csproj +++ b/北京北汽/Controller/CK.SCP.Controller.csproj @@ -84,6 +84,7 @@ + diff --git a/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs b/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs index 28000db..5f321ea 100644 --- a/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs +++ b/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs @@ -16,6 +16,7 @@ using System.Threading; using System.Threading.Tasks; using System.Transactions; using System.Data.Entity.Core; +using System.Security.Cryptography; //using WebSrvAPITest; namespace CK.SCP.Controller @@ -26,6 +27,25 @@ namespace CK.SCP.Controller { } + /// + /// 随机密码 + /// + /// + 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> Get_TEA_SUBSCRIBE_List(TEA_SUBSCRIBE p_entity) { ResultObject> _ret = new ResultObject>(); @@ -2063,7 +2083,8 @@ namespace CK.SCP.Controller User _entity = new User(); _entity.Name = vendname; _entity.Remark = _supplier.Site.ToUpper(); - _entity.Password = PasswordUtil.CreateDbPassword("99999999"); + // 随机密码 + _entity.Password = GenerateComplexPassword(); //PasswordUtil.CreateDbPassword("99999999"); _entity.ChineseName = _supplier.VendName; _entity.Email = _supplier.VendId + "@163.com"; _entity.Gender = "男"; diff --git a/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs b/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs index b3c7840..5bea1a4 100644 --- a/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs +++ b/北京北汽/Controller/SCP_TA_LANGUAGE_CONTROLLER.cs @@ -145,6 +145,15 @@ namespace CK.SCP.Controller } 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 => { diff --git a/北京北汽/Controller/SCP_TB_ADDRESS_BUYER_CONTROLLER.cs b/北京北汽/Controller/SCP_TB_ADDRESS_BUYER_CONTROLLER.cs new file mode 100644 index 0000000..e9e56d2 --- /dev/null +++ b/北京北汽/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 +{ + /// + /// 采购对应收货管理地址 + /// + public class SCP_TB_ADDRESS_BUYER_CONTROLLER + { + /// + /// 获取采购收货地址对应关系 + /// + /// 采购 + /// + public static void GetTbAddressBuyerList(string Buyer, Action>> p_action) + { + ResultObject> _ret = new ResultObject>(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + IQueryable 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; + } + } + + + /// + /// 导入 + /// + /// + /// + /// + public static ResultObject EXCEL_ADRESS_BUYER_LIST(List p_order_list, string p_creator) + { + ResultObject _ret = new ResultObject(); + try + { + using (ScpEntities db = EntitiesFactory.CreateScpInstance()) + { + List lineError = new List(); + List ErrorList = new List(); + var _lst = p_order_list; + List 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; + } + + + + /// + /// 校验 查看是否有错误 + /// + /// 导入文件 + /// 地址uidlist + /// + public static List Checked(List p_order_list, List ulist) + { + List errorlist = new List(); + List userName = new List(); + using (AppBoxContext db = EntitiesFactory.CreateAppBoxInstance()) + { + List 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; + } + /// + /// 删除 + /// + /// uid列表 + /// + public static ResultObject DeleteByUid(List uidlist) + { + ResultObject _ret = new ResultObject(); + 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; + } + } +} diff --git a/北京北汽/Models/CK.SCP.Models.csproj b/北京北汽/Models/CK.SCP.Models.csproj index 7c762e7..f3a81e4 100644 --- a/北京北汽/Models/CK.SCP.Models.csproj +++ b/北京北汽/Models/CK.SCP.Models.csproj @@ -344,6 +344,7 @@ + @@ -351,6 +352,7 @@ + diff --git a/北京北汽/Models/ScpEntities.cs b/北京北汽/Models/ScpEntities.cs index 94c6b1d..e7bfdc3 100644 --- a/北京北汽/Models/ScpEntities.cs +++ b/北京北汽/Models/ScpEntities.cs @@ -165,6 +165,8 @@ namespace CK.SCP.Models public virtual DbSet V_TB_ASK_DETAIL_PO { get; set; } + public virtual DbSet TB_ADDRESS_BUYER { get; set; } + protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity() diff --git a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ADDRESS_BUYER_EXPORT.cs b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_ADDRESS_BUYER_EXPORT.cs new file mode 100644 index 0000000..48efa1c --- /dev/null +++ b/北京北汽/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; } + } +} diff --git a/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PRICE_Update_EXPORT.cs b/北京北汽/Models/ScpEntity/ExcelExportEnttity/SCP_PRICE_Update_EXPORT.cs new file mode 100644 index 0000000..ec2d78d --- /dev/null +++ b/北京北汽/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; } + } +} diff --git a/北京北汽/Models/ScpEntity/TB_ADDRESS_BUYER.cs b/北京北汽/Models/ScpEntity/TB_ADDRESS_BUYER.cs new file mode 100644 index 0000000..374784f --- /dev/null +++ b/北京北汽/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; } + } + } diff --git a/北京北汽/SCP/SCP.csproj b/北京北汽/SCP/SCP.csproj index 55bdc34..08141f1 100644 --- a/北京北汽/SCP/SCP.csproj +++ b/北京北汽/SCP/SCP.csproj @@ -275,6 +275,7 @@ + @@ -5134,6 +5135,13 @@ SCP_TA_VEND_PART.aspx + + SCP_TB_Address_Buyer.aspx + ASPXCodeBehind + + + SCP_TB_Address_Buyer.aspx + SCP_TB_Address.aspx ASPXCodeBehind diff --git a/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx b/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx index efdeb2c..9b7ac85 100644 --- a/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx +++ b/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx @@ -32,12 +32,12 @@ ShowHeader="False" AllowPaging="True" PageSize="50" OnPageIndexChange="Grid1_OnPageIndexChange" ShowBorder="False" - DataKeyNames ="UID,Site,Name,Subsite,Phone" AllowSorting="true" IsDatabasePaging="true" SortField="Address" > + DataKeyNames ="UID,NamePhone,Address" AllowSorting="true" IsDatabasePaging="true" SortField="UID" > - - + + - + diff --git a/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx.cs b/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx.cs index b84518f..7e0d18f 100644 --- a/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx.cs +++ b/北京北汽/SCP/Views/BasicData/SCP_TB_Address.aspx.cs @@ -121,6 +121,11 @@ namespace SCP.Views.BasicData _dt = ExcelHelper.GetDataTableOfXlsx(_stream); } var list = ConvertHelper.ToList(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); if (ret.State == ReturnStatus.Succeed && ret.Result == true) { diff --git a/北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx b/北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx new file mode 100644 index 0000000..b76d8e7 --- /dev/null +++ b/北京北汽/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" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.cs b/北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.cs new file mode 100644 index 0000000..a565adf --- /dev/null +++ b/北京北汽/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(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> 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(); + } + + /// + /// 上传文件 + /// + /// + /// + 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(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("
", ret.MessageList)); + } + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + int[] selections = Grid1.SelectedRowIndexArray; + if (selections.Count() == 0) + { + PageContext.RegisterStartupScript(Alert.GetShowInTopReference("没有选择数据!")); + return; + } + List uidlist = new List(); + 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("
", ret.MessageList))); + return; + } + else + { + Alert.Show(GetResourceKey(ret.Message)); + } + } + + + } + + } +} \ No newline at end of file diff --git a/北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.designer.cs b/北京北汽/SCP/Views/BasicData/SCP_TB_Address_Buyer.aspx.designer.cs new file mode 100644 index 0000000..d2ba0fb --- /dev/null +++ b/北京北汽/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 + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Toolbar Toolbar1; + + /// + /// Button3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button Button3; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnDelete; + + /// + /// txtBuyer 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.TextBox txtBuyer; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnSearch; + + /// + /// FileUp 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.FileUpload FileUp; + + /// + /// btnInput 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Button btnInput; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.Grid Grid1; + } +} diff --git a/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs b/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs index 7f8d8bc..81962a4 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs +++ b/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs @@ -45,22 +45,24 @@ namespace SCP.PlanData var _ls = ScpCache.ADRESSList; DDL_Site.DataSource = _ls; DDL_Site.DataBind(); - List stinglist = new List(); - 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); + var name = CurrentUser.Name.ToString(); + var buyer = SCPDB.TB_ADDRESS_BUYER.FirstOrDefault(q => q.Buyer == name); + //List stinglist = new List(); + //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 (buyer != null) + { + DDL_Site.SelectedIndex = _ls.IndexOf( _ls.FirstOrDefault(q=> q.UID == buyer.AddressUID)); } } public void LoadData() diff --git a/北京北汽/SCP/Views/PlanData/SCP_PO_ASK.aspx b/北京北汽/SCP/Views/PlanData/SCP_PO_ASK.aspx index d20c931..3041939 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_PO_ASK.aspx +++ b/北京北汽/SCP/Views/PlanData/SCP_PO_ASK.aspx @@ -130,7 +130,7 @@ -