diff --git a/SCP/SCP.csproj b/SCP/SCP.csproj
index f67e90b..9e753fd 100644
--- a/SCP/SCP.csproj
+++ b/SCP/SCP.csproj
@@ -2920,23 +2920,18 @@
-
-
-
-
-
@@ -5137,13 +5132,6 @@
ASN_STATE.aspx
-
- MakeSupplierAccount.aspx
- ASPXCodeBehind
-
-
- MakeSupplierAccount.aspx
-
SCP_ASK.aspx
ASPXCodeBehind
@@ -5172,13 +5160,6 @@
SCP_PART_LIFE_DETAIL.aspx
-
- SCP_PLAN_DETAIL.aspx
- ASPXCodeBehind
-
-
- SCP_PLAN_DETAIL.aspx
-
SCP_INCOMPLETE_ASK.aspx
ASPXCodeBehind
@@ -5200,20 +5181,6 @@
SCP_ASN_DETAIL_View.aspx
-
- SCP_PLAN_LIST.aspx
- ASPXCodeBehind
-
-
- SCP_PLAN_LIST.aspx
-
-
- SCP_PLAN_VENDER.aspx
- ASPXCodeBehind
-
-
- SCP_PLAN_VENDER.aspx
-
SCP_PO_PLAN_EXTEND.aspx
@@ -5248,13 +5215,6 @@
SCP_RECEIVE_EXTEND.aspx
-
- SCP_RECEIVE_PLAN.aspx
- ASPXCodeBehind
-
-
- SCP_RECEIVE_PLAN.aspx
-
SCP_ASK_UNCOMPLETE.aspx
ASPXCodeBehind
@@ -6285,6 +6245,8 @@
62030
/
http://localhost:6789/
+ True
+ http://localhost:6789/
False
False
diff --git a/SCP/Views/PlanData/MakeSupplierAccount.aspx b/SCP/Views/PlanData/MakeSupplierAccount.aspx
deleted file mode 100644
index 7cef774..0000000
--- a/SCP/Views/PlanData/MakeSupplierAccount.aspx
+++ /dev/null
@@ -1,40 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MakeSupplierAccount.aspx.cs" Inherits="SCP.Views.PlanData.MakeSupplierAccount" %>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SCP/Views/PlanData/MakeSupplierAccount.aspx.cs b/SCP/Views/PlanData/MakeSupplierAccount.aspx.cs
deleted file mode 100644
index e745e20..0000000
--- a/SCP/Views/PlanData/MakeSupplierAccount.aspx.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-using CK.SCP.Controller;
-using CK.SCP.Models.AppBoxEntity;
-using FineUI;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-
-namespace SCP.Views.PlanData
-{
- public partial class MakeSupplierAccount : PageBase
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- BindVender();
- }
-
- }
- private void BindVender()
- {
- if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0)
- {
- var ls = SCP_TB_VENDER_CONTROLLER.Getlist(CurrentUser.FactoryList.FirstOrDefault());
-
- var lsVender=ls.Where(p => p.VendId.Substring(0, 1) == "R").ToList();
- lsVender.ForEach(p => {
- p.VendName = string.Format("{0}({1})", p.VendName, p.VendId);
- });
- ddl_Vender.DataSource = lsVender;
- ddl_Vender.DataTextField = "VendName";
- ddl_Vender.DataValueField = "VendId";
- ddl_Vender.DataBind();
- }
- }
-
-
-
-
-
- protected void btnCreate_Click(object sender, EventArgs e)
- {
- try
- {
- string _username = ddl_Vender.SelectedValue + "@" + CurrentUser.FactoryList.FirstOrDefault();
- var userList = DB.Users.Where(p => p.Name == _username).ToList();
- if (userList.Count == 0)
- {
- User item = new User();
- item.Name = _username;
- if (string.IsNullOrEmpty(TXT_PASSWORD.Text))
- {
- item.Password = PasswordUtil.CreateDbPassword("666666");
- }
- else
- {
- item.Password = PasswordUtil.CreateDbPassword(TXT_PASSWORD.Text);
- }
- item.ChineseName = ddl_Vender.SelectedText;
- item.Gender = "男";
- item.CompanyEmail = ddl_Vender.SelectedValue + "@" + CurrentUser.FactoryList.FirstOrDefault() + ".com";
- item.Email = ddl_Vender.SelectedValue + "@" + CurrentUser.FactoryList.FirstOrDefault() + ".com";
- item.Remark = CurrentUser.FactoryList.FirstOrDefault();
- item.Enabled = true;
- item.CreateTime = DateTime.Now;
- item.SupplierCode = ddl_Vender.SelectedValue;
- if (!string.IsNullOrEmpty(ddl_Vender.SelectedValue))
- {
- var _role = DB.Roles.Where(p => p.Name == "供应商").FirstOrDefault();
- if (_role != null)
- {
- item.Roles = new List();
- int[] roleIDs = new int[] { _role.ID };
- AddEntities(item.Roles, roleIDs);
- }
- item.SupplierCode = ddl_Vender.SelectedValue;
- }
- DB.Users.Add(item);
- }
- else
- {
- Alert.Show("用户已经存在,不能创建!");
- return;
- }
- if (DB.SaveChanges() != -1)
- {
- try
- {
- var user = DB.Users.Where(p => p.Name == _username).FirstOrDefault();
- if (user != null)
- {
- if (!string.IsNullOrEmpty(CurrentUser.FactoryList.FirstOrDefault()))
- {
- var _VenderUsers = DB.VenderUsers.Where(p => p.UserId == user.ID).ToList();
- if (_VenderUsers != null && _VenderUsers.Count > 0)
- {
- DB.VenderUsers.RemoveRange(_VenderUsers);
- }
- List _vList = new List();
- VenderUsers _vus = new VenderUsers();
- _vus.UserId = user.ID;
- _vus.VenderId = ddl_Vender.SelectedValue;
- _vList.Add(_vus);
- if (_vList.Count > 0)
- {
- var ls = _vList.Where(p => p.UserId > 0 && !string.IsNullOrEmpty(p.VenderId));
- DB.VenderUsers.AddRange(ls.ToArray());
- }
- }
- }
- if (DB.SaveChanges() != -1)
- {
- try
- {
- var user1 = DB.Users.Where(p => p.Name == _username).FirstOrDefault();
- var _factory = CurrentUser.FactoryList.FirstOrDefault();
- var _f = DB.TA_FACTORY.Where(p => p.FactoryId == _factory).FirstOrDefault();
- int[] titleIDs = new int[] { _f.ID };
- user1.TA_FACTORY = new List();
- AddEntities(user1.TA_FACTORY, titleIDs);
- if(DB.SaveChanges()!=-1)
- {
- Alert.Show("供应商账号初始化成功");
- lbName.Text = "生成账号:" +ddl_Vender.SelectedValue + "@" + CurrentUser.FactoryList.FirstOrDefault();
- return;
- }
- }
- catch (Exception ex)
- {
- Alert.Show(ex.Message);
- return;
- }
- }
- }
- catch (Exception ex)
- {
- Alert.Show(ex.Message);
- return;
- }
- }
- }
- catch (Exception ex)
- {
- Alert.Show(ex.Message);
- }
-
-
- }
- }
-}
\ No newline at end of file
diff --git a/SCP/Views/PlanData/MakeSupplierAccount.aspx.designer.cs b/SCP/Views/PlanData/MakeSupplierAccount.aspx.designer.cs
deleted file mode 100644
index a3abb92..0000000
--- a/SCP/Views/PlanData/MakeSupplierAccount.aspx.designer.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//------------------------------------------------------------------------------
-// <自动生成>
-// 此代码由工具生成。
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,则所做更改将丢失。
-// 自动生成>
-//------------------------------------------------------------------------------
-
-namespace SCP.Views.PlanData {
-
-
- public partial class MakeSupplierAccount {
-
- ///
- /// form1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
- ///
- /// Panel1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Panel Panel1;
-
- ///
- /// extForm1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Form extForm1;
-
- ///
- /// ddl_Vender 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.DropDownList ddl_Vender;
-
- ///
- /// TXT_PASSWORD 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.TextBox TXT_PASSWORD;
-
- ///
- /// btnCreate 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Button btnCreate;
-
- ///
- /// lbName 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Label lbName;
- }
-}
diff --git a/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx b/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx
deleted file mode 100644
index 775813b..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx
+++ /dev/null
@@ -1,51 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PLAN_DETAIL.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_PLAN_DETAIL" %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx.cs b/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx.cs
deleted file mode 100644
index 32e0774..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-using CK.SCP.Controller;
-using CK.SCP.Models.Enums;
-using CK.SCP.Models.ScpEntity;
-using CK.SCP.Utils;
-using FineUI;
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-
-namespace SCP.Views.SupplierData
-{
- public partial class SCP_PLAN_DETAIL : PageBase
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- Bind();
- }
- }
-
- private void Bind()
- {
- LoadData((rs) => {
-
- DataTable _dt = ExcelHelper.GetDataTableExtend(rs);
- foreach (DataColumn column in _dt.Columns)
- {
- if (!column.ColumnName.Contains("计划类型") &&
- !column.ColumnName.Contains("零件编码") &&
- !column.ColumnName.Contains("零件名称") &&
- !column.ColumnName.Contains("供应商编码") &&
- !column.ColumnName.Contains("供应商名称") &&
- !column.ColumnName.Contains("运输周期") &&
- !column.ColumnName.Contains("域") &&
- !column.ColumnName.Contains("地点") &&
- !column.ColumnName.Contains("行号") &&
- !column.ColumnName.Contains("版本号")
- )
- {
- FineUI.RenderField bf;
- bf = new FineUI.RenderField();
- bf.Width = 180;
- bf.Editor.Add(new NumberBox() { MinValue = 0, MaxValue = 99999999 });
- bf.DataField = column.ColumnName;
- bf.SortField = column.ColumnName;
- bf.HeaderText = column.ColumnName;
- Grid1.Columns.Add(bf);
- DDL_PLAN.Items.Add(column.ColumnName, column.ColumnName);
- }
- else
- {
- FineUI.BoundField bf;
- bf = new FineUI.BoundField();
- bf.DataField = column.ColumnName;
- bf.DataFormatString = "{0}";
- bf.SortField = column.ColumnName;
- bf.HeaderText = column.ColumnName;
- Grid1.Columns.Add(bf);
- }
- }
- Grid1.DataSource = _dt;
- Grid1.DataBind();
-
-
- });
- }
- private void LoadData(Action p_action)
- {
- TB_PLAN_CUSTOM _plan = new TB_PLAN_CUSTOM();
- _plan.UID = long.Parse(Request["UID"]);
- SCP_PLAN_CONTROLLER.Get_TB_PLAN_CUSTOM_List(_plan, (rs) => {
- if (rs.State == ReturnStatus.Succeed)
- {
- var _entity = rs.Result.ToList().FirstOrDefault();
- switch (_entity.PlanType.Trim())
- {
- case "DAY":
- string urlPath = "/DayPlan/" + _entity.PlanData; // 文件下载的URL地址,供给前台下载
- string filePath = HttpContext.Current.Server.MapPath("\\" + urlPath); // 文件路径
- // RenderTable(filePath);
- p_action(filePath);
- break;
- case "WEEK":
- string urlPath1 = "/WeekPlan/" + _entity.PlanData; // 文件下载的URL地址,供给前台下载
- string filePath1 = HttpContext.Current.Server.MapPath("\\" + urlPath1); // 文件路径
- p_action(filePath1);
- break;
- case "MONTH":
- string urlPath2 = "/MonthPlan/" + _entity.PlanData; // 文件下载的URL地址,供给前台下载
- string filePath2 = HttpContext.Current.Server.MapPath("\\" + urlPath2); // 文件路径
- p_action(filePath2);
- break;
- }
- }
-
- });
- }
- private void ImportExcel()
- {
-
- }
-
- protected void Grid1_Sort(object sender, GridSortEventArgs e)
- {
- // Dictionary _dic = new Dictionary();
- string str = e.SortDirection;
-
- if (e.SortField.Contains("/"))
- {
- //_dic.Add(e.SortDirection,)
- // Session["Bill"] = _dic;
- }
- }
-
- protected void btnAdd_Click(object sender, EventArgs e)
- {
- LoadData((p_filePath) => {
- DataTable _dt = ExcelHelper.GetDataTableExtend(p_filePath);
- TB_ASK _ask = new TB_ASK();
- _ask.VendId=_dt.Rows[0]["供应商编码"].ToString();
- _ask.Site=_dt.Rows[0]["域"].ToString();
- _ask.PoBillNum = _ask.VendId;
- _ask.State = (int)AskState.New;
- _ask.IsDeleted = false;
- _ask.ModType = (int)BillModType.Contract;
- _ask.CreateUser =CurrentUser.Name;
- _ask.CreateTime =DateTime.Now;
- _ask.ErpBillNum = _ask.PoBillNum;
- _ask.GUID = Guid.NewGuid();
- var _first=SCPDB.TA_VENDER.Where(p => p.VendId == _ask.VendId).FirstOrDefault();
- foreach (DataRow _row in _dt.Rows)
- {
- TB_ASK_DETAIL _askDetail = new TB_ASK_DETAIL();
- _askDetail.PoBillNum = _ask.PoBillNum;
- _askDetail.TempQty = 0;
- _askDetail.Currency = _first.Currency;
- _askDetail.CreateTime = _ask.CreateTime;
- _askDetail.CreateUser = _askDetail.CreateUser;
- foreach (DataColumn column in _dt.Columns)
- {
- //row[column.ColumnName]
- switch (column.ColumnName)
- {
- case "零件编码":
- _askDetail.PartCode = _row[column.ColumnName].ToString();
- break;
- //case "运输周期":
- // _askDetail.PartCode = _row[column.ColumnName].ToString();
- // break;
- case "行号":
- _askDetail.PoLine = int.Parse(_row[column.ColumnName].ToString());
- break;
- }
- if (column.ColumnName == DDL_PLAN.SelectedValue)
- {
- _askDetail.AskQty = decimal.Parse(_row[column.ColumnName].ToString());
- column.ColumnName.Split(new char[] {','});
-
-
- //_askDetail.BeginTime
-
- }
- }
- }
- });
-
- }
- }
-
-
-
-
-}
diff --git a/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx.designer.cs b/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx.designer.cs
deleted file mode 100644
index c31d62c..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_DETAIL.aspx.designer.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//------------------------------------------------------------------------------
-// <自动生成>
-// 此代码由工具生成。
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,则所做更改将丢失。
-// 自动生成>
-//------------------------------------------------------------------------------
-
-namespace SCP.Views.SupplierData {
-
-
- public partial class SCP_PLAN_DETAIL {
-
- ///
- /// form2 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::System.Web.UI.HtmlControls.HtmlForm form2;
-
- ///
- /// Panel1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Panel Panel1;
-
- ///
- /// Toolbar2 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Toolbar Toolbar2;
-
- ///
- /// DDL_PLAN 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.DropDownList DDL_PLAN;
-
- ///
- /// btnAdd 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Button btnAdd;
-
- ///
- /// Grid1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Grid Grid1;
-
- ///
- /// Grid2 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Grid Grid2;
-
- ///
- /// Window1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Window Window1;
-
- ///
- /// WindowUpload 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Window WindowUpload;
- }
-}
diff --git a/SCP/Views/PlanData/SCP_PLAN_LIST.aspx b/SCP/Views/PlanData/SCP_PLAN_LIST.aspx
deleted file mode 100644
index 3243062..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_LIST.aspx
+++ /dev/null
@@ -1,71 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PLAN_LIST.aspx.cs" Inherits="SCP.Views.PlanData.SCP_PLAN_LIST" %>
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SCP/Views/PlanData/SCP_PLAN_LIST.aspx.cs b/SCP/Views/PlanData/SCP_PLAN_LIST.aspx.cs
deleted file mode 100644
index facfa05..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_LIST.aspx.cs
+++ /dev/null
@@ -1,494 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using CK.SCP.Models.Enums;
-using CK.SCP.Models.ScpEntity;
-using CK.SCP.Utils;
-using CK.SCP.Controller;
-using FineUI;
-using SCP.Code;
-using CK.SCP.Models;
-using System.Text;
-using System.Data.Entity.SqlServer;
-using System.Data;
-using System.IO;
-using NPOI.XSSF.UserModel;
-using NPOI.SS.UserModel;
-
-namespace SCP.Views.PlanData
-{
- public partial class SCP_PLAN_LIST :PageBase
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- BindDetail();
- }
- }
-
- public void SearchV_TB_ASK_DETAILData(Action> p_action)
- {
- V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
- if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
- {
- _entity.VendId = CurrentUser.VenderList[0];
- }
- _entity.IsDeleted = false;
- _entity.EndTime = DateTime.Now;
- SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>
- {
- if (_ret.State == ReturnStatus.Succeed)
- {
- p_action(_ret.Result);
- }
- });
- }
- public void BindDetail()
- {
- SearchV_TB_ASK_DETAILData((ret) =>
- {
- ret = ret.Where(p => SqlFunctions.IsNumeric(p.Remark) >0);
- var _verList =ret.Select(p => p.Remark).ToList();
- var _vlist=_verList.Distinct().ToList();
- if (_vlist.Count > 0)
- {
- List _ls1 = new List();
- _vlist.ForEach(p =>
- {
- _ls1.Add(long.Parse(p));
- });
- ret = ret.Where(p => p.Remark ==_ls1.Max().ToString() && p.AskBillNum.Contains("K_"));
- }
- Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
- var list = SortAndPage(ret, Grid_V_TB_ASK_DETAIL,"ASC");
- var _ls = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(list.ToList());
- Grid_V_TB_ASK_DETAIL.DataSource = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(_ls);
- Grid_V_TB_ASK_DETAIL.DataBind();
- });
- }
-
-
- protected void btnOutput_Click(object sender, EventArgs e)
- {
- V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
- if (CurrentUser.VenderList != null && CurrentUser.VenderList.Count > 0)
- {
- _entity.VendId = CurrentUser.VenderList[0];
- }
- SearchV_TB_ASK_DETAILData((ret) => {
- Dictionary cellheader = new Dictionary(){
- {"PoBillNum" , "发货单号" },
- { "VendName" , "供应商" },
- { "EndTime" , "到货日期" },
- { "PoLine" , "行号" },
- { "PartCode" , "零件编号" },
- { "PartDesc1" , "零件名称" },
- { "AskQty" , "需求数量" },
- { "PoUnit" , "单位" },
- { "BeginTime" , "发布日期" },
- };
- string url = EntityListToExcel2003(cellheader, ret.ToList(), "发货单明细");
- });
- }
-
-
-
-
- protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
- {
- BindDetail();
- }
-
-
- protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
- {
- Grid_V_TB_ASK_DETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
- BindDetail();
- }
- public static string Upload(FineUI.FileUpload fUpload, string ext, TB_CLAIM_APPEND model)
- {
- string[] allowedExtensions = { ".xls", ".xlsx" };//允许上传的文件类型
- string filename = ""; //MyWebString.GetOrderNumber();
- bool fileOK = false;
- //fUpload.PostedFile.ContentLength
- string fileExtension = System.IO.Path.GetExtension(fUpload.FileName).ToLower();
- for (int i = 0; i < allowedExtensions.Length; i++)
- {
- if (fileExtension == allowedExtensions[i])
- {
- fileOK = true;
- }
- }
- if (ext != "")
- {
- if (fileExtension != ext.ToLower())
- {
- throw new Exception("只能上传 " + ext + " 类型的文件!");
- }
- }
- if (fileOK)
- {
- if (fUpload.HasFile)
- {
- //上传新附件前把旧的删除
- if (!string.IsNullOrEmpty(model.FileNameMD5))
- {
- if (File.Exists(System.Web.HttpContext.Current.Server.MapPath("~//") + model.FileNameMD5))
- {
- File.Delete(System.Web.HttpContext.Current.Server.MapPath("~/ClaimFiles/") + model.FileNameMD5);
- }
- }
- filename = Path.GetFileName(fUpload.FileName);
- model.FileName = filename;
- //filename = GetMD5HashFromFile(filename); //TODO 将文件名改为MD5
- filename = System.Guid.NewGuid().ToString("N");
- filename = filename + fileExtension;
- //filename = Path.GetFileName(fUpload.FileName);
- model.FileNameMD5 = filename;
-
- if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath("~/ClaimFiles/") + filename))
- {
- fUpload.SaveAs(System.Web.HttpContext.Current.Server.MapPath("~/ClaimFiles/") + filename);
- }
- //else
- //{
- // File.Delete(System.Web.HttpContext.Current.Server.MapPath("~/uploadfiles/") + filename);
- //}
- }
- else
- {
- throw new Exception("文件上传失败!");
- }
- }
- else
- {
- throw new Exception("上传文件格式不正确!");
- }
- return filename;
- }
-
- //private void ImportExcel()
- //{
- // 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);
- // }
-
-
-
-
-
-
- // //foreach (DataRow row in _dt.Rows)
- // //{
- // // foreach (DataColumn column in _dt.Columns)
- // // {
- // // switch (column.ColumnName)
- // // {
- // // case "供应商编码":
- // // //_row[column.ColumnName] = itm.VendId;
- // // break;
- // // case "零件编码":
- // // //_row[column.ColumnName] = itm.PartCode;
- // // break;
- // // case "供应商名称":
- // // //_row[column.ColumnName] = itm.VendName;
- // // break;
- // // case "零件名称":
- // // //_row[column.ColumnName] = (string.IsNullOrEmpty(itm.PartDesc1) ? string.Empty : itm.PartDesc1) + (string.IsNullOrEmpty(itm.PartDesc2) ? string.Empty : itm.PartDesc2);
- // // break;
- // // case "运输周期":
- // // //_row[column.ColumnName] = txtPlanDay.Text;
- // // break;
- // // case "域":
- // // //_row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- // // break;
- // // case "地点":
- // // //_row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- // // break;
- // // default:
-
-
-
- // // column.ColumnName
-
-
- // // //_row[column.ColumnName] = "0";
- // // break;
- // // }
- // // }
- // //}
- //}
-
- //private void ExportExcel()
- //{
- // string _pobillnum = "RCSCAIP";
- // string _domain = "CNS";
- // string _site = "CNS";
- // int _day = int.Parse(txtPlanDay.Text);
- // DataTable _table = new DataTable();
- // _table.Columns.Add(new DataColumn() { ColumnName = "零件编码" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "零件名称" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "供应商编码" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "供应商名称" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "运输周期" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "域" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "地点" });
-
- // SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(new V_TB_PO_DETAIL() { PoBillNum = _pobillnum, Site = _domain }, (rs) =>
- // {
- // if (rs.State == ReturnStatus.Succeed)
- // {
- // switch (DDL_PLAN.SelectedValue)
- // {
- // case "0":
- // DateTime _dt = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- // for (int i = 0; i < 15; i++)
- // {
- // _dt.AddDays(0 - _day);
- // _table.Columns.Add(new DataColumn() { ColumnName = _dt.AddDays(0 - _day).ToShortDateString() + "/" + _dt.ToShortDateString() });
- // _dt = _dt.AddDays(1);
- // }
- // break;
- // case "1":
- // DateTime _dt1 = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- // for (int i = 0; i < 15; i++)
- // {
- // _table.Columns.Add(new DataColumn() { ColumnName = _dt1.AddDays(0 - _day).ToShortDateString() + "/" + _dt1.ToShortDateString() });
- // _dt1 = _dt1.AddDays(7);
- // }
- // break;
- // case "2":
- // DateTime _dt2 = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- // for (int i = 0; i < 15; i++)
- // {
- // _table.Columns.Add(new DataColumn() { ColumnName = _dt2.AddDays(0 - _day).ToShortDateString() + "/" + _dt2.ToShortDateString() });
- // _dt2 = _dt2.AddMonths(1);
- // }
- // break;
- // }
- // var _result = rs.Result.ToList();
- // foreach (var itm in _result)
- // {
- // var _row = _table.NewRow();
- // foreach (DataColumn column in _table.Columns)
- // {
- // switch (column.ColumnName)
- // {
- // case "供应商编码":
- // _row[column.ColumnName] = itm.VendId;
- // break;
- // case "零件编码":
- // _row[column.ColumnName] = itm.PartCode;
- // break;
- // case "供应商名称":
- // _row[column.ColumnName] = itm.VendName;
- // break;
- // case "零件名称":
- // _row[column.ColumnName] = (string.IsNullOrEmpty(itm.PartDesc1) ? string.Empty : itm.PartDesc1) + (string.IsNullOrEmpty(itm.PartDesc2) ? string.Empty : itm.PartDesc2);
- // break;
- // case "运输周期":
- // _row[column.ColumnName] = txtPlanDay.Text;
- // break;
- // case "域":
- // _row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- // break;
- // case "地点":
- // _row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- // break;
- // default:
- // _row[column.ColumnName] = "0";
- // break;
- // }
- // }
- // _table.Rows.Add(_row);
- // }
- // }
- // });
-
- // string str = JsonHelper.GetJson(_table);
- // DataSet _ds = new DataSet();
- // _ds.Tables.Add(_table);
- // DataSetToExcel(_ds, "导出计划");
- //}
-
- //protected void btnMake_Click(object sender, EventArgs e)
- //{
- // string _pobillnum = "RCSCAIP";
- // string _domain = "CNS";
- // string _site = "CNS";
- // int _day = int.Parse(txtPlanDay.Text);
- // DataTable _table = new DataTable();
- // _table.Columns.Add(new DataColumn() { ColumnName = "零件编码" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "零件名称" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "供应商编码" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "供应商名称" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "运输周期" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "域" });
- // _table.Columns.Add(new DataColumn() { ColumnName = "地点" });
-
- // SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(new V_TB_PO_DETAIL() { PoBillNum = _pobillnum, Site = _domain }, (rs) =>
- // {
- // if (rs.State == ReturnStatus.Succeed)
- // {
- // switch (DDL_PLAN.SelectedValue)
- // {
- // case "0":
- // DateTime _dt = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- // for (int i = 0; i < 15; i++)
- // {
- // _dt.AddDays(0 - _day);
- // _table.Columns.Add(new DataColumn() { ColumnName= _dt.AddDays(0 - _day).ToShortDateString() + "/" + _dt.ToShortDateString() });
- // _dt = _dt.AddDays(1);
- // }
- // break;
- // case "1":
- // DateTime _dt1 = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- // for (int i = 0; i < 15; i++)
- // {
-
- // _table.Columns.Add(new DataColumn() { ColumnName = _dt1.AddDays(0 - _day).ToShortDateString() + "/" + _dt1.ToShortDateString() });
- // _dt1 = _dt1.AddDays(7);
- // }
- // break;
- // case "2":
- // DateTime _dt2 = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- // for (int i = 0; i < 15; i++)
- // {
- // _table.Columns.Add(new DataColumn() { ColumnName = _dt2.AddDays(0 - _day).ToShortDateString() + "/" + _dt2.ToShortDateString() });
- // _dt2 = _dt2.AddMonths(1);
- // }
- // break;
- // }
- // var _result = rs.Result.ToList();
- // foreach (var itm in _result)
- // {
- // var _row = _table.NewRow();
- // foreach (DataColumn column in _table.Columns)
- // {
- // switch (column.ColumnName)
- // {
- // case "供应商编码":
- // _row[column.ColumnName] = itm.VendId;
- // break;
- // case "零件编码":
- // _row[column.ColumnName] = itm.PartCode;
- // break;
- // case "供应商名称":
- // _row[column.ColumnName] = itm.VendName;
- // break;
- // case "零件名称":
- // _row[column.ColumnName] = (string.IsNullOrEmpty(itm.PartDesc1) ? string.Empty : itm.PartDesc1) + (string.IsNullOrEmpty(itm.PartDesc2) ? string.Empty : itm.PartDesc2);
- // break;
- // case "运输周期":
- // _row[column.ColumnName] = txtPlanDay.Text;
- // break;
- // case "域":
- // _row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- // break;
- // case "地点":
- // _row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- // break;
- // default:
- // _row[column.ColumnName] = "0";
- // break;
- // }
- // }
- // _table.Rows.Add(_row);
- // }
- // }
- // });
-
- // string str= JsonHelper.GetJson(_table);
- // DataSet _ds =new DataSet();
- // _ds.Tables.Add(_table);
- // DataSetToExcel(_ds, "导出计划");
- //}
-
- protected void btnImport_Click(object sender, EventArgs e)
- {
-
- }
-
- //private MemoryStream RenderDataTableToExcel(DataTable SourceTable)
- //{
- // XSSFWorkbook workbook = null;
- // MemoryStream ms = null;
- // ISheet sheet = null;
- // XSSFRow headerRow = null;
- // try
- // {
- // workbook = new XSSFWorkbook();
- // ms = new MemoryStream();
- // sheet = workbook.CreateSheet();
- // headerRow = (XSSFRow)sheet.CreateRow(0);
- // foreach (DataColumn column in SourceTable.Columns)
- // headerRow.CreateCell(column.Ordinal).SetCellValue(column.ColumnName);
- // int rowIndex = 1;
- // foreach (DataRow row in SourceTable.Rows)
- // {
- // XSSFRow dataRow = (XSSFRow)sheet.CreateRow(rowIndex);
- // foreach (DataColumn column in SourceTable.Columns)
- // dataRow.CreateCell(column.Ordinal).SetCellValue(row[column].ToString());
- // ++rowIndex;
- // }
- // //列宽自适应,只对英文和数字有效
- // for (int i = 0; i <= SourceTable.Columns.Count; ++i)
- // sheet.AutoSizeColumn(i);
- // workbook.Write(ms);
- // ms.Flush();
- // }
- // catch (Exception ex)
- // {
- // return null;
- // }
- // finally
- // {
- // ms.Close();
- // sheet = null;
- // headerRow = null;
- // workbook = null;
- // }
- // return ms;
- //}
- //private void DownloadExcel(DataTable dt, string reportName)
- //{
- // MemoryStream ms = RenderDataTableToExcel(dt);
- // if (ms != null)
- // {
-
- // Response.AddHeader("Content-Disposition", string.Format("attachment;filename=" + HttpUtility.UrlEncode(reportName) + DateTime.Now.ToString("yyyyMMdd") + ".xlsx"));
- // Response.AddHeader("Content-Length", ms.ToArray().Length.ToString());
- // Response.BinaryWrite(ms.ToArray());
- // Response.Flush();
- // ms.Close();
- // ms.Dispose();
- // }
- // else
- // Response.Write("出错,无法下载!");
- //}
-
- }
-}
\ No newline at end of file
diff --git a/SCP/Views/PlanData/SCP_PLAN_LIST.aspx.designer.cs b/SCP/Views/PlanData/SCP_PLAN_LIST.aspx.designer.cs
deleted file mode 100644
index 95f030e..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_LIST.aspx.designer.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//------------------------------------------------------------------------------
-// <自动生成>
-// 此代码由工具生成。
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,则所做更改将丢失。
-// 自动生成>
-//------------------------------------------------------------------------------
-
-namespace SCP.Views.PlanData {
-
-
- public partial class SCP_PLAN_LIST {
-
- ///
- /// form1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
- ///
- /// Panel1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Panel Panel1;
-
- ///
- /// Toolbar2 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Toolbar Toolbar2;
-
- ///
- /// btnOutput 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Button btnOutput;
-
- ///
- /// Grid_V_TB_ASK_DETAIL 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Grid Grid_V_TB_ASK_DETAIL;
-
- ///
- /// ToolbarSeparator1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
-
- ///
- /// ToolbarText1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.ToolbarText ToolbarText1;
-
- ///
- /// ddlGridPageSize 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.DropDownList ddlGridPageSize;
-
- ///
- /// Window1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Window Window1;
-
- ///
- /// WindowUpload 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Window WindowUpload;
-
- ///
- /// TXT_ModType 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.HiddenField TXT_ModType;
-
- ///
- /// TXT_State 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.HiddenField TXT_State;
- }
-}
diff --git a/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx b/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx
deleted file mode 100644
index 722af2f..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx
+++ /dev/null
@@ -1,74 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PLAN_VENDER.aspx.cs" Inherits="SCP.Views.PlanData.SCP_PLAN_VENDER" %>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx.cs b/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx.cs
deleted file mode 100644
index a25d4cd..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx.cs
+++ /dev/null
@@ -1,361 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using CK.SCP.Models.Enums;
-using CK.SCP.Models.ScpEntity;
-using CK.SCP.Utils;
-using CK.SCP.Controller;
-using FineUI;
-using SCP.Code;
-using CK.SCP.Models;
-using System.Text;
-using System.Data.Entity.SqlServer;
-using System.Data;
-using System.IO;
-using NPOI.XSSF.UserModel;
-using NPOI.SS.UserModel;
-
-namespace SCP.Views.PlanData
-{
- public partial class SCP_PLAN_VENDER : PageBase
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- BindVender(ddl_Vender);
- BindDetail();
- }
- }
- public void BindDetail()
- {
- TB_PLAN_CUSTOM _plan = new TB_PLAN_CUSTOM();
- SCP_PLAN_CONTROLLER.Get_TB_PLAN_CUSTOM_List(_plan, (rs) => {
- if(rs.State==ReturnStatus.Succeed)
- {
- Grid1.DataSource= rs.Result.ToList();
- Grid1.DataBind();
- }
- });
- }
-
-
- protected void btnOutput_Click(object sender, EventArgs e)
- {
-
- }
-
-
-
-
- protected void Grid_V_TB_ASK_DETAIL_PageIndexChange(object sender, GridPageEventArgs e)
- {
- BindDetail();
- }
-
-
-
- public string Upload(FineUI.FileUpload p_file, string ext, PlanType p_type)
- {
- string[] allowedExtensions = { ".xls", ".xlsx" };//允许上传的文件类型
- string filename = ""; //MyWebString.GetOrderNumber();
- bool fileOK = false;
- //fUpload.PostedFile.ContentLength
- string fileExtension = System.IO.Path.GetExtension(p_file.FileName).ToLower();
- for (int i = 0; i < allowedExtensions.Length; i++)
- {
- if (fileExtension == allowedExtensions[i])
- {
- fileOK = true;
- }
- }
- if (ext != "")
- {
- if (fileExtension != ext.ToLower())
- {
- throw new Exception("只能上传 " + ext + " 类型的文件!");
- }
- }
- if (fileOK)
- {
- if (p_file.HasFile)
- {
- //上传新附件前把旧的删除
- filename = Path.GetFileName(p_file.FileName);
- //model.FileName = filename;
- //filename = GetMD5HashFromFile(filename); //TODO 将文件名改为MD5
- filename = System.Guid.NewGuid().ToString("N");
- filename = filename + fileExtension;
- //filename = Path.GetFileName(fUpload.FileName);
- //model.FileNameMD5 = filename;
- filename = filename + fileExtension;
- switch (p_type)
- {
- case PlanType.DAY:
- if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath("~/DayPlan/") + filename))
- {
- p_file.SaveAs(System.Web.HttpContext.Current.Server.MapPath("~/DayPlan/") + filename);
- }
- break;
- case PlanType.WEEK:
- if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath("~/WeekPlan/") + filename))
- {
- p_file.SaveAs(System.Web.HttpContext.Current.Server.MapPath("~/WeekPlan/") + filename);
- }
- break;
- case PlanType.MONTH:
- if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath("~/MonthPlan/") + filename))
- {
- p_file.SaveAs(System.Web.HttpContext.Current.Server.MapPath("~/MonthPlan/") + filename);
- }
- break;
- }
- }
- else
- {
- throw new Exception("文件上传失败!");
- }
- }
- else
- {
- throw new Exception("上传文件格式不正确!");
- }
- return filename;
- }
-
- private void ImportExcel()
- {
- 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);
- }
-
- TB_PLAN_CUSTOM _plan = new TB_PLAN_CUSTOM();
-
- if (_dt.Rows.Count > 0 && _dt.Rows[0]["计划类型"] != null)
- {
- _plan.VendID = _dt.Rows[0]["供应商编码"].ToString();
- _plan.Version = DateTime.Now.ToString("yyyyMMddHHmmssfff");
- _plan.Domain = CurrentUser.FactoryList.FirstOrDefault();
- _plan.Site = CurrentUser.FactoryList.FirstOrDefault();
-
- if (_dt.Rows[0]["计划类型"].ToString() == "日")
- {
- var ep = new EpPlusHelper();
- DataSet _ds = new DataSet();
- _dt.Columns.Add(new DataColumn() { ColumnName = "版本号" });
- foreach(DataRow row in _dt.Rows)
- {
- row["版本号"] = _plan.Version;
- }
- _ds.Tables.Add(_dt);
- string fileName = Guid.NewGuid().ToString("N") + ".xls"; // 文件名称
- string urlPath = "/DayPlan/" + fileName; // 文件下载的URL地址,供给前台下载
- string filePath = HttpContext.Current.Server.MapPath("\\" + urlPath); // 文件路径 // 1.检测是否存在文件夹,若不存在就建立个文件夹
- string directoryName = Path.GetDirectoryName(filePath);
- if (!Directory.Exists(directoryName))
- {
- Directory.CreateDirectory(directoryName);
- }
- ep.WriteDataSetToExcel(_ds, filePath, "", null);
-
- _plan.PlanData = fileName;
- _plan.PlanType = PlanType.DAY.ToString();
- }
- if (_dt.Rows[0]["计划类型"].ToString() == "周")
- {
- var ep = new EpPlusHelper();
- DataSet _ds = new DataSet();
-
- _dt.Columns.Add(new DataColumn() { ColumnName = "版本号" });
- foreach (DataRow row in _dt.Rows)
- {
- row["版本号"] = _plan.Version;
- }
-
- _ds.Tables.Add(_dt);
- string fileName = Guid.NewGuid().ToString("N") + ".xls"; // 文件名称
- string urlPath = "/WeekPlan/" + fileName; // 文件下载的URL地址,供给前台下载
- string filePath = HttpContext.Current.Server.MapPath("\\" + urlPath); // 文件路径
- // 1.检测是否存在文件夹,若不存在就建立个文件夹
- string directoryName = Path.GetDirectoryName(filePath);
- if (!Directory.Exists(directoryName))
- {
- Directory.CreateDirectory(directoryName);
- }
- ep.WriteDataSetToExcel(_ds, filePath, "", null);
- _plan.PlanData = fileName;
- _plan.PlanType = PlanType.WEEK.ToString();
- }
- if (_dt.Rows[0]["计划类型"].ToString() == "月")
- {
- var ep = new EpPlusHelper();
- DataSet _ds = new DataSet();
- _dt.Columns.Add(new DataColumn() { ColumnName = "版本号" });
- foreach (DataRow row in _dt.Rows)
- {
- row["版本号"] = _plan.Version;
- }
- _ds.Tables.Add(_dt);
- string fileName = Guid.NewGuid().ToString("N") + ".xls"; // 文件名称
- string urlPath = "/MonthPlan/" + fileName; // 文件下载的URL地址,供给前台下载
- string filePath = HttpContext.Current.Server.MapPath("\\" + urlPath); // 文件路径
- // 1.检测是否存在文件夹,若不存在就建立个文件夹
- string directoryName = Path.GetDirectoryName(filePath);
- if (!Directory.Exists(directoryName))
- {
- Directory.CreateDirectory(directoryName);
- }
- ep.WriteDataSetToExcel(_ds, filePath, "", null);
- _plan.PlanData = fileName;
- _plan.PlanType = PlanType.MONTH.ToString();
-
- }
- _plan.CreateUser = CurrentUser.Name;
- _plan.CreateTime = DateTime.Now;
-
- var _ret=SCP_PLAN_CONTROLLER.Save_TB_PLAN_CUSTOM(new List() { _plan });
- if (_ret.State == ReturnStatus.Succeed)
- {
- Alert.Show("计划上传成功");
- }
- }
- }
-
- private void ExportExcel()
- {
- string _pobillnum = ddl_Vender.SelectedValue ;
- string _domain = CurrentUser.FactoryList.FirstOrDefault();
- string _site = CurrentUser.FactoryList.FirstOrDefault();
- int _day = int.Parse(txtPlanDay.Text);
- DataTable _table = new DataTable();
- _table.Columns.Add(new DataColumn() { ColumnName = "计划类型" });
- _table.Columns.Add(new DataColumn() { ColumnName = "零件编码" });
-
- _table.Columns.Add(new DataColumn() { ColumnName = "供应商编码" });
-
- _table.Columns.Add(new DataColumn() { ColumnName = "行号" });
- SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(new V_TB_PO_DETAIL() { PoBillNum = _pobillnum, Site = _domain }, (rs) =>
- {
- if (rs.State == ReturnStatus.Succeed)
- {
- switch (DDL_PLAN.SelectedValue)
- {
- case "0":
- DateTime _dt = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- for (int i = 0; i < 15; i++)
- {
- _dt.AddDays(0 - _day);
- _table.Columns.Add(new DataColumn() { ColumnName = _dt.AddDays(0 - _day).ToShortDateString() + "/" + _dt.ToShortDateString() });
- _dt = _dt.AddDays(1);
- }
- break;
- case "1":
- DateTime _dt1 = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- for (int i = 0; i < 15; i++)
- {
- _table.Columns.Add(new DataColumn() { ColumnName = _dt1.AddDays(0 - _day).ToShortDateString() + "/" + _dt1.ToShortDateString() });
- _dt1 = _dt1.AddDays(7);
- }
- break;
- case "2":
- DateTime _dt2 = (dp_ArriveDate.SelectedDate != null) ? dp_ArriveDate.SelectedDate.Value : DateTime.Now;
- for (int i = 0; i < 15; i++)
- {
- _table.Columns.Add(new DataColumn() { ColumnName = _dt2.AddDays(0 - _day).ToShortDateString() + "/" + _dt2.ToShortDateString() });
- _dt2 = _dt2.AddMonths(1);
- }
- break;
- }
- _table.Columns.Add(new DataColumn() { ColumnName = "供应商名称" });
- _table.Columns.Add(new DataColumn() { ColumnName = "零件名称" });
- _table.Columns.Add(new DataColumn() { ColumnName = "运输周期" });
- _table.Columns.Add(new DataColumn() { ColumnName = "域" });
- _table.Columns.Add(new DataColumn() { ColumnName = "地点" });
-
- var _result = rs.Result.ToList();
- foreach (var itm in _result)
- {
- var _row = _table.NewRow();
- foreach (DataColumn column in _table.Columns)
- {
- switch (column.ColumnName)
- {
- case "供应商编码":
- _row[column.ColumnName] = itm.VendId;
- break;
- case "零件编码":
- _row[column.ColumnName] = itm.PartCode;
- break;
- case "供应商名称":
- _row[column.ColumnName] = itm.VendName;
- break;
- case "零件名称":
- _row[column.ColumnName] = (string.IsNullOrEmpty(itm.PartDesc1) ? string.Empty : itm.PartDesc1) + (string.IsNullOrEmpty(itm.PartDesc2) ? string.Empty : itm.PartDesc2);
- break;
- case "运输周期":
- _row[column.ColumnName] = txtPlanDay.Text;
- break;
- case "域":
- _row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- break;
- case "地点":
- _row[column.ColumnName] = CurrentUser.FactoryList.FirstOrDefault();
- break;
- case "计划类型":
- _row[column.ColumnName] =DDL_PLAN.SelectedText;
- break;
- case "行号":
- _row[column.ColumnName] =itm.PoLine;
- break;
- default:
- _row[column.ColumnName] = "0";
- break;
- }
- }
- _table.Rows.Add(_row);
- }
- }
- });
-
- string str = JsonHelper.GetJson(_table);
- DataSet _ds = new DataSet();
- _ds.Tables.Add(_table);
- DataSetToExcel(_ds, "导出计划");
- }
-
- protected void btnMake_Click(object sender, EventArgs e)
- {
- ExportExcel();
- }
-
- protected void btnImport_Click(object sender, EventArgs e)
- {
- ImportExcel();
- }
-
- protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
- {
- object[] rowDataKeys = Grid1.DataKeys[e.RowIndex];
- string uid= rowDataKeys[0].ToString();
- PageContext.RegisterStartupScript(Window1.GetShowReference(string.Format("../PlanData/SCP_PLAN_DETAIL.aspx?UID={0}", uid)));
- }
- }
-}
\ No newline at end of file
diff --git a/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx.designer.cs b/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx.designer.cs
deleted file mode 100644
index 27a9b74..0000000
--- a/SCP/Views/PlanData/SCP_PLAN_VENDER.aspx.designer.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//------------------------------------------------------------------------------
-// <自动生成>
-// 此代码由工具生成。
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,则所做更改将丢失。
-// 自动生成>
-//------------------------------------------------------------------------------
-
-namespace SCP.Views.PlanData {
-
-
- public partial class SCP_PLAN_VENDER {
-
- ///
- /// form1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
- ///
- /// Panel1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Panel Panel1;
-
- ///
- /// Toolbar2 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Toolbar Toolbar2;
-
- ///
- /// btnOutput 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Button btnOutput;
-
- ///
- /// ddl_Vender 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.DropDownList ddl_Vender;
-
- ///
- /// DDL_PLAN 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.DropDownList DDL_PLAN;
-
- ///
- /// txtPlanDay 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.NumberBox txtPlanDay;
-
- ///
- /// dp_ArriveDate 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.DatePicker dp_ArriveDate;
-
- ///
- /// btnMake 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Button btnMake;
-
- ///
- /// FileUp 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.FileUpload FileUp;
-
- ///
- /// btnImport 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Button btnImport;
-
- ///
- /// Grid1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Grid Grid1;
-
- ///
- /// Window1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Window Window1;
-
- ///
- /// WindowUpload 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.Window WindowUpload;
-
- ///
- /// TXT_ModType 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.HiddenField TXT_ModType;
-
- ///
- /// TXT_State 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUI.HiddenField TXT_State;
- }
-}
diff --git a/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx b/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx
deleted file mode 100644
index 65203bd..0000000
--- a/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx
+++ /dev/null
@@ -1,17 +0,0 @@
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_RECEIVE_PLAN.aspx.cs" Inherits="SCP.Views.PlanData.SCP_RECEIVE_PLAN" %>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx.cs b/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx.cs
deleted file mode 100644
index f30a584..0000000
--- a/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-
-namespace SCP.Views.PlanData
-{
- public partial class SCP_RECEIVE_PLAN : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
-
- }
- }
-}
\ No newline at end of file
diff --git a/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx.designer.cs b/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx.designer.cs
deleted file mode 100644
index 14a97e8..0000000
--- a/SCP/Views/PlanData/SCP_RECEIVE_PLAN.aspx.designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-//
-// 对此文件的更改可能会导致不正确的行为,并且如果
-// 重新生成代码,这些更改将会丢失。
-//
-//------------------------------------------------------------------------------
-
-namespace SCP.Views.PlanData
-{
-
-
- public partial class SCP_RECEIVE_PLAN
- {
-
- ///
- /// form1 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::System.Web.UI.HtmlControls.HtmlForm form1;
- }
-}