代码无效引用清理,试压包资料界面看板修改

This commit is contained in:
2025-10-10 14:33:21 +08:00
parent 87fb529521
commit 55b798135c
933 changed files with 5897 additions and 7541 deletions
@@ -28,7 +28,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (!IsPostBack)
{
this.ProjectId = this.CurrUser.LoginProjectId;
BLL.UnitService.GetALLUnit(this.drpUnit, true);
BLL.UnitService.GetALLUnit(this.drpUnit, true);
BLL.MainItemService.InitMainItemDownList(drpMainItem, this.ProjectId, true);
btnNew.OnClientClick = Window1.GetShowReference("MaterialManageEdit.aspx") + "return false;";
GetButtonPower();
@@ -111,7 +111,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
else
{
var oldView = Funs.DB.HJGL_MaterialManage.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitId== Material.UnitId && x.ArrivalDate == Material.ArrivalDate
var oldView = Funs.DB.HJGL_MaterialManage.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitId == Material.UnitId && x.ArrivalDate == Material.ArrivalDate
&& x.MaterialName == Material.MaterialName && x.SpecificationAndModel == Material.SpecificationAndModel);
if (oldView == null)
{
@@ -5,8 +5,6 @@ using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
@@ -161,13 +159,13 @@ namespace FineUIPro.Web.HJGL.PreDesign
var oldViewInfos = from x in Funs.DB.HJGL_MaterialManage
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == this.CurrUser.LoginProjectId
select new { x.ProjectId,y.UnitName,x.MaterialName,x.SpecificationAndModel,x.ArrivalDate};
select new { x.ProjectId, y.UnitName, x.MaterialName, x.SpecificationAndModel, x.ArrivalDate };
var units = from x in Funs.DB.Base_Unit
select x;
var mainItems = from x in Funs.DB.ProjectData_MainItem where x.ProjectId == this.CurrUser.LoginProjectId select x;
for (int i = 0; i < ir; i++)
{
var oldViewInfo = oldViewInfos.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitName== pds.Rows[i][1].ToString()
var oldViewInfo = oldViewInfos.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.UnitName == pds.Rows[i][1].ToString()
&& x.MaterialName == pds.Rows[i][3].ToString() && x.SpecificationAndModel == pds.Rows[i][4].ToString() && x.ArrivalDate == Funs.GetNewDateTime(pds.Rows[i][10].ToString()));
if (oldViewInfo == null)
{
@@ -1,5 +1,4 @@
using BLL;
using System;
using System;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
@@ -32,7 +31,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// 绑定数据
/// </summary>
private void BindGrid()
{
{
var list = BLL.HJGLPackagingmanageService.GetPackagingManageList(this.CurrUser.LoginProjectId, this.txtPackagingCode.Text.Trim(), this.Grid1.PageIndex, this.Grid1.PageSize);
Grid1.RecordCount = list.Total;
Grid1.DataSource = list.Data;
@@ -326,6 +325,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("ProjectName", ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId));
keyValuePairs.Add("PackagingCode", model.PackagingCode);
keyValuePairs.Add("Remark", model.Remark);
keyValuePairs.Add("PlanStartDate", PlanStartDate);
keyValuePairs.Add("StackingPosition", model.StackingPosition);
keyValuePairs.Add("ContactName", model.ContactName + "| " + model.ContactPhone);
@@ -1,12 +1,7 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -14,11 +9,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
public string PackagingManageId
{
get
{
get
{
return (string)ViewState["PackagingManageId"];
}
set
set
{
ViewState["PackagingManageId"] = value;
}
@@ -34,7 +29,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
drpTypeInt.DataValueField = "Value";
drpTypeInt.DataSource = HJGLPackagingmanageService.TypeIntMap;
drpTypeInt.DataBind();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
if (!string.IsNullOrEmpty(PackagingManageId))
@@ -43,16 +38,16 @@ namespace FineUIPro.Web.HJGL.PreDesign
drpTypeInt.Enabled = false;
txtPackagingCode.Text = model.PackagingCode;
dropPipelineComponentCode.Values = model.PipelineComponentId?.Split(',');
txtStackingPosition.Text = model.StackingPosition;
txtStackingPosition.Text = model.StackingPosition;
drpTrainNumber.SelectedValue = model.TrainNumberId;
drpTypeInt.SelectedValue = model.TypeInt.ToString();
if (model.State== HJGLPackagingmanageService.state_0)
if (model.State == HJGLPackagingmanageService.state_0)
{
btnSave.Hidden = false;
}
}
else
{
{
drpTypeInt.Enabled = true;
btnSave.Hidden = false;
txtPackagingCode.Text = HJGLPackagingmanageService.GetNewPackagingCode(this.CurrUser.LoginProjectId);
@@ -66,17 +61,17 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
Grid1.DataSource = HJGL_PipelineComponentService.GetAcceptedPipelineComponent(CurrUser.LoginProjectId,
txtpipelineCode.Text.Trim(), txtpipelineComponentCode.Text.Trim(), txtflowingSection.Text.Trim());
Grid1 .DataBind();
Grid1.DataBind();
}
private void BindGrid2(string PackagingManageId)
{
{
Grid2.DataSource = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId);
Grid2.DataBind();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
{
Save();
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
@@ -105,7 +100,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
BLL.HJGLPackagingmanageService.AddHJGL_PackagingManage(table);
PackagingManageId= table.PackagingManageId;
PackagingManageId = table.PackagingManageId;
}
else
{
@@ -120,11 +115,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
//table.ContactPhone =txtContactPhone.Text;
table.TrainNumberId = drpTrainNumber.SelectedValue;
table.TypeInt = int.Parse(drpTypeInt.SelectedValue);
if (drpTypeInt.SelectedValue ==((int)HJGLPackagingmanageService.TypeInt.).ToString())
if (drpTypeInt.SelectedValue == ((int)HJGLPackagingmanageService.TypeInt.).ToString())
{
table.PipelineComponentId = string.Join(",", dropPipelineComponentCode.Values);
var newDetailList= new List<Model.HJGL_PackagingManageDetail>();
var newDetailList = new List<Model.HJGL_PackagingManageDetail>();
foreach (var item in dropPipelineComponentCode.Values)
{
var ComponentModel = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(item);
@@ -135,11 +130,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
Id = SQLHelper.GetNewID(),
PackagingManageId = this.PackagingManageId,
PipelineId = ComponentModel.PipelineId,
PipelineComponentId = item,
PipelineComponentId = item,
CreateTime = DateTime.Now,
CreateUser = this.CurrUser.PersonId,
};
newDetailList.Add(model);
newDetailList.Add(model);
}
}
HJGLPackagingmanagedetailService.DeleteByPackagingManageId(this.PackagingManageId);
@@ -203,20 +198,20 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (drpTypeInt.SelectedValue == ((int)HJGLPackagingmanageService.TypeInt.).ToString())
{
dropPipelineComponentCode.Hidden=false;
Grid2.Hidden=true;
dropPipelineComponentCode.Hidden = false;
Grid2.Hidden = true;
BindGrid();
}
else
else
{
dropPipelineComponentCode.Hidden = true;
Grid2.Hidden = false;
btnSelect.Hidden = false;
//btnSelectStock.Hidden = true;
BindGrid2(this.PackagingManageId);
BindGrid2(this.PackagingManageId);
}
}
protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
{
@@ -104,7 +104,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
List<Model.WBS_UnitWork> unitWork2 = null;
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
if (unitWork2.Count() > 0)
{
@@ -164,8 +164,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
else
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
{
this.BindGrid(this.tvControlItem.SelectedNodeID);
}
@@ -184,16 +184,16 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
DataRowView row = e.DataItem as DataRowView;
string id = e.RowID;
if (Funs.DB.HJGL_PackagingManageDetail.Any(x=>x.TwOutputDetailId==id))
if (Funs.DB.HJGL_PackagingManageDetail.Any(x => x.TwOutputDetailId == id))
{
e.RowSelectable = false;
e.RowSelectable = false;
}
;
}
private void BindGrid(string outputMasterId)
{
////var Prelist = HJGL_PipelineComponentService.GetPipelinePrefabricatedComponent(unitworkid, pipelineId);
////var inoutplandetail = (from x in Funs.DB.HJGL_PackagingManageDetail
//// where x.PipelineId == pipelineId
//// && (x.PipelineComponentId == null || x.PipelineComponentId == "")
@@ -1,16 +1,11 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class PackagingManageSelectStock : PageBase
public partial class PackagingManageSelectStock : PageBase
{
public string PackagingManageId
{
@@ -38,15 +33,15 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// 绑定数据
/// </summary>
private void BindGrid()
{
{
Model.Tw_MaterialStockOutput table = new Model.Tw_MaterialStockOutput();
table.PipeLineMatCode = txtMatCode.Text.Trim();
table.WarehouseCode = "工厂预制";
table.ProjectId = this.CurrUser.LoginProjectId;
table.ProjectId = this.CurrUser.LoginProjectId;
var tb = BLL.TwMaterialstockService.GetTw_MaterialStockByModle(table);
var inoutplandetail = (from x in Funs.DB.HJGL_PackagingManageDetail
where x.PackagingManageId == PackagingManageId
where x.PackagingManageId == PackagingManageId
select x).ToList();
var queryList = tb;
// 优化 Linq 过滤条件,过滤已经进入包装的预制散件
@@ -55,7 +50,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
from y in yy.DefaultIfEmpty()
where y == null
select x).ToList();
Grid1.RecordCount = result.Count;
Grid1.RecordCount = result.Count;
Grid1.DataSource = result;
Grid1.DataBind();
}
@@ -84,11 +79,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var id in List_Id)
{
var StockModel = TwMaterialstockService.GetTw_MaterialStockById(id);
var StockModel = TwMaterialstockService.GetTw_MaterialStockById(id);
var model = new Model.HJGL_PackagingManageDetail()
{
Id = SQLHelper.GetNewID(),
PackagingManageId = this.PackagingManageId,
PackagingManageId = this.PackagingManageId,
MaterialCode = StockModel.PipeLineMatCode,
Number = 0,
CreateTime = DateTime.Now,
@@ -98,7 +93,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
}
}
#endregion
#region GV
@@ -1,13 +1,6 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class PackagingManageView : PageBase
@@ -47,39 +40,39 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
var pack = HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
if (pack == null) return;
var detailList= HJGLPackagingmanageService.GetPackagingDetailById(PackagingManageId);
var detailList = HJGLPackagingmanageService.GetPackagingDetailById(PackagingManageId);
Grid1.RecordCount = detailList.Count();
Grid1.DataSource = detailList;
Grid1.DataBind();
/* if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制组件)
{
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
/* if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制组件)
{
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
var result = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
var detailList = from x in result
select new
{
PipelineComponentId = x.Id,
PipelineComponentCode = x.MaterialCode,
num = x.Number,
CU = x.MaterialUnit,
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
x.FlowingSection,
};
Grid1.RecordCount = detailList.Count();
Grid1.DataSource = detailList;
Grid1.DataBind();
}*/
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
var result = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
var detailList = from x in result
select new
{
PipelineComponentId = x.Id,
PipelineComponentCode = x.MaterialCode,
num = x.Number,
CU = x.MaterialUnit,
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
x.FlowingSection,
};
Grid1.RecordCount = detailList.Count();
Grid1.DataSource = detailList;
Grid1.DataBind();
}*/
}
#endregion
@@ -1,18 +1,15 @@
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.DataVisualization.Charting;
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class PipelingDivide : PageBase
{
public static List<Model.HJGL_Pipeline> view_HJGL_Pipelines =new List<Model.HJGL_Pipeline>();
public static List<Model.HJGL_Pipeline> view_HJGL_Pipelines = new List<Model.HJGL_Pipeline>();
public decimal PipelineComplete
{
get
@@ -35,11 +32,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
ViewState["PipelineNOComplete"] = value;
}
}
public string Line_No
public string Line_No
{
get
{
return (string)ViewState["Line_No"];
return (string)ViewState["Line_No"];
}
set
{
@@ -48,11 +45,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
protected void Page_Load(object sender, EventArgs e)
{
// ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
// ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
if (!IsPostBack)
{
// this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
// this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.InitTreeMenu();//加载树
PipelineComplete = 0;
PipelineNOComplete = 0;
@@ -110,8 +107,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -154,27 +151,27 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
this.BindGrid();
// var q = view_HJGL_Pipelines.Where(x => x.PipeArea == PipelineService.PipeArea_SHOP);
// if (q.Any())
// {
// List<string> listpipecode = new List<string>();
// foreach (var item in q)
// {
// listpipecode.Add("/" + item.PipelineCode);
// }
// Line_No = string.Join(",", listpipecode);
// }
// Model.Parameter3D parameter3D = new Model.Parameter3D();
// Model.ColorModel colorModel = new Model.ColorModel();
// colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
// parameter3D.ColorModel = colorModel;
// parameter3D.TagNum = Line_No;
// parameter3D.ButtonType = "1";
// parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
//// parameter3D.Line_No = Line_No;
// ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
// ctlAuditFlow.data = parameter3D;
// ctlAuditFlow.BindData();
// var q = view_HJGL_Pipelines.Where(x => x.PipeArea == PipelineService.PipeArea_SHOP);
// if (q.Any())
// {
// List<string> listpipecode = new List<string>();
// foreach (var item in q)
// {
// listpipecode.Add("/" + item.PipelineCode);
// }
// Line_No = string.Join(",", listpipecode);
// }
// Model.Parameter3D parameter3D = new Model.Parameter3D();
// Model.ColorModel colorModel = new Model.ColorModel();
// colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
// parameter3D.ColorModel = colorModel;
// parameter3D.TagNum = Line_No;
// parameter3D.ButtonType = "1";
// parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
//// parameter3D.Line_No = Line_No;
// ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
// ctlAuditFlow.data = parameter3D;
// ctlAuditFlow.BindData();
}
#endregion
@@ -193,23 +190,23 @@ namespace FineUIPro.Web.HJGL.PreDesign
view_HJGL_Pipeline.SingleName = this.txtSingleName.Text.Trim();
// view_HJGL_Pipeline.MaterialCode=this.txtMaterialCode.Text.Trim();
var list = BLL.PipelineService.GetHJGL_PipelineList(view_HJGL_Pipeline);
if (!string .IsNullOrEmpty(this.txtMaterialCode.Text.Trim()))
if (!string.IsNullOrEmpty(this.txtMaterialCode.Text.Trim()))
{
list = (from x in list
join y in Funs.DB.HJGL_PipeLineMat on x.PipelineId equals y.PipelineId
where y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
select x).Distinct().ToList();
}
view_HJGL_Pipelines = list;
view_HJGL_Pipelines = list;
// 2.获取当前分页数据
Grid1.RecordCount = list.Count();
// 2.获取当前分页数据
// 3.绑定到Grid
var table = this.GetPagedDataTable(Grid1, list);
var table = this.GetPagedDataTable(Grid1, list);
Grid1.DataSource = table;
Grid1.DataBind();
//lbSinglePreRate.Text= GetSinglePreRateByUnitWork(this.tvControlItem.SelectedNodeID);
@@ -252,7 +249,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
// Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
// Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
#endregion
@@ -277,8 +274,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
var Id =Grid1.SelectedRowIDArray;
List<string > listpipecode=new List<string> () ;
var Id = Grid1.SelectedRowIDArray;
List<string> listpipecode = new List<string>();
foreach (var item in Id)
{
var q = PipelineService.GetPipelineByPipelineId(item);
@@ -292,7 +289,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
parameter3D.TagNum = pipecode;
parameter3D.ButtonType = "1";
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
// parameter3D.Line_No = Line_No;
// parameter3D.Line_No = Line_No;
ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
ctlAuditFlow.data = parameter3D;
@@ -371,7 +368,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
txtPipelineCode.Text = String.Empty;
txtSingleName.Text = String.Empty;
txtMaterialCode.Text = String.Empty;
txtMaterialCode.Text = String.Empty;
BindGrid();
}
@@ -382,13 +379,13 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (PipeArea != null)
{
var q = PipelineService.GetPipeArea().Where(x => x.Value == PipeArea.ToString());
if (q!=null&&q.Count()>0)
if (q != null && q.Count() > 0)
{
PipeAreaValue = q.First().Text;
}
}
else
{
return "";
@@ -403,11 +400,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
private string GetSinglePreRateByUnitWork(string unitworkid)
{
var db = Funs.DB;
var pipeline=from x in db.View_HJGL_Pipeline where x.UnitWorkId == unitworkid && x.PipeArea=="1" select x;
var pipeline = from x in db.View_HJGL_Pipeline where x.UnitWorkId == unitworkid && x.PipeArea == "1" select x;
var q = from x in db.View_HJGL_WeldJoint where x.UnitWorkId == unitworkid select x;
string rate = "";
if (q != null && q.Count() > 0&&pipeline.Count()>0)
if (q != null && q.Count() > 0 && pipeline.Count() > 0)
{
var proSum = (from x in q
join y in pipeline on x.PipelineId equals y.PipelineId into temp
@@ -419,12 +416,12 @@ namespace FineUIPro.Web.HJGL.PreDesign
SizeSum = g.Sum(x => x.Size)
}).FirstOrDefault().SizeSum;
var AllSum = (from x in pipeline
group x by x.UnitWorkId into g
select new
{
SizeSum = g.Sum(x => x.TotalDin)
}).FirstOrDefault().SizeSum;
group x by x.UnitWorkId into g
select new
{
SizeSum = g.Sum(x => x.TotalDin)
}).FirstOrDefault().SizeSum;
proSum = (proSum != null) ? proSum : 0;
if (AllSum > 0)
{
@@ -1,14 +1,11 @@
using BLL;
using MiniExcelLibs;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Web;
namespace FineUIPro.Web.HJGL.PreDesign
@@ -16,7 +13,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
public partial class PrePipeline : PageBase
{
public int pageSize = 20;
public static DataTable GridDataTable=new DataTable ();
public static DataTable GridDataTable = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
@@ -24,11 +21,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.InitTreeMenu();//加载树
HJGL_PipelineComponentService.InitMainItemDownList(drpState,true);
HJGL_PipelineComponentService.InitMainItemDownProductionStateList(drpProductionState,true);
HJGL_PipelineComponentService.InitMainItemDownList(drpState, true);
HJGL_PipelineComponentService.InitMainItemDownProductionStateList(drpProductionState, true);
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId
where x.ProjectId == this.CurrUser.LoginProjectId
select x.FlowingSection).Distinct().ToList();
this.drpFlowingSection.DataTextField = "Value";
this.drpFlowingSection.DataValueField = "Value";
@@ -84,8 +81,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -98,7 +95,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
tn1.CommandName = 1+"|"+Funs.GetEndPageNumber(a, pageSize);
tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn1.EnableClickEvent = true;
tn1.EnableExpandEvent = true;
rootNode1.Nodes.Add(tn1);
@@ -149,18 +146,18 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
}
}
private void BindNodes(TreeNode node)
{
{
List<Model.HJGL_Pipeline> pipeline = new List<Model.HJGL_Pipeline>();
var pipelines = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" select x;
var pipelines = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.PipeArea == "1" select x;
pipeline = (from x in pipelines
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
orderby x.PipelineCode
select x).ToList();
int pageindex =int.Parse(node.CommandName.Split('|')[0]);
int pageCount= int.Parse(node.CommandName.Split('|')[1]);
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
if (pageindex <= pageCount)
{
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
@@ -174,9 +171,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
newNode.NodeID = item.PipelineId;
newNode.EnableClickEvent = true;
node.Nodes.Add(newNode);
}
if (pageindex <pageCount)
if (pageindex < pageCount)
{
TreeNode newNode = new TreeNode();
newNode.Text = "加载";
@@ -187,8 +184,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
node.Nodes.Add(newNode);
}
}
}
#endregion
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
@@ -222,7 +219,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (pipeline != null)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
}
}
}
else if (e.CommandName == "加载")
{
@@ -241,9 +238,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// 数据绑定
/// </summary>
private void BindGrid()
{
if (tvControlItem.SelectedNode==null) return;
if (tvControlItem.SelectedNode == null) return;
string strSql = @" SELECT distinct com.PipelineComponentId,com.PipelineComponentCode,com.BoxNumber,com.Remark,
com.PipelineId, punit.UnitName AS PreUnit,aunit.UnitName AS AssembleUnit,com.IsPrint,
com.QRCode,com.State,com.ProductionState,pipe.PlanStartDate,pipe.FlowingSection,com.DrawingName,com.ReceiveDate,
@@ -264,14 +261,14 @@ namespace FineUIPro.Web.HJGL.PreDesign
listStr.Add(new SqlParameter("@UnitWorkId", this.tvControlItem.SelectedNodeID));
}
else if (tvControlItem.SelectedNode.CommandName=="管线")
else if (tvControlItem.SelectedNode.CommandName == "管线")
{
strSql += " and com.PipelineId = @PipelineId ";
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
}
if (drpWeldingDailyCode.SelectedValue!=Const._Null &&!string.IsNullOrEmpty(drpWeldingDailyCode.SelectedValue))
if (drpWeldingDailyCode.SelectedValue != Const._Null && !string.IsNullOrEmpty(drpWeldingDailyCode.SelectedValue))
{
strSql += " and joint.WeldingDailyId = @WeldingDailyId ";
listStr.Add(new SqlParameter("@WeldingDailyId", drpWeldingDailyCode.SelectedValue));
@@ -283,7 +280,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
listStr.Add(new SqlParameter("@PipelineComponentCode", "%" + this.txtPipelineComponentCode.Text.Trim() + "%"));
}
if (drpState.SelectedValue!=Const._Null)
if (drpState.SelectedValue != Const._Null)
{
strSql += " AND com.State =@State";
listStr.Add(new SqlParameter("@State", drpState.SelectedValue));
@@ -374,10 +371,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
HJGL_PipelineComponentService.UpdateIsPrint(Grid1.SelectedRowIDArray); //打印后修改打印状态
}
}
}
private bool Print(string[] PipelineComponentId)
{
{
BLL.FastReportService.ResetData();
var result = HJGL_PipelineComponentService.GetPrintModelByPipelineComponentIds(PipelineComponentId, null, false);
@@ -388,7 +385,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
else
{
ShowNotify("请查看组件是否上传二维码!", MessageBoxIcon.Question);
ShowNotify("请查看组件是否上传二维码!", MessageBoxIcon.Question);
return false;
}
BLL.FastReportService.AddFastreportTable(tb);
@@ -587,7 +584,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
return txt;
}
}
return StateName;
}
protected void btnImportQRCode_Click(object sender, EventArgs e)
@@ -606,7 +603,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
return;
}
var SingleName = (from x in Funs.DB.HJGL_Pipeline_Component where x.PipelineComponentId == id select (x.DrawingName)).FirstOrDefault();
var filemodel = BLL.HJGL_DataImportService.GetLatestFileByFileName(SingleName,"3", this.CurrUser.LoginProjectId);
var filemodel = BLL.HJGL_DataImportService.GetLatestFileByFileName(SingleName, "3", this.CurrUser.LoginProjectId);
if (filemodel != null)
{
string httpUrl = filemodel.FilePath;
@@ -624,19 +621,19 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void btnAccept_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIDArray.Length>0)
if (Grid1.SelectedRowIDArray.Length > 0)
{
foreach (var item in Grid1.SelectedRowIDArray)
{
var model = HJGL_PipelineComponentService.GetPipelineComponentById(item);
if (model.ProductionState==2)
if (model.ProductionState == 2)
{
BLL.APIPipelineComponentService.GetComponentConfirmArrival(PipelineComponentId: item, this.CurrUser.PersonId,""); ;
BLL.APIPipelineComponentService.GetComponentConfirmArrival(PipelineComponentId: item, this.CurrUser.PersonId, ""); ;
}
}
ShowNotify("操作成功",MessageBoxIcon.Success);
ShowNotify("操作成功", MessageBoxIcon.Success);
BindGrid();
}
else
@@ -672,20 +669,20 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void btnOut_Click(object sender, EventArgs e)
{
if (GridDataTable!=null)
if (GridDataTable != null)
{
var q = (from x in GridDataTable.AsEnumerable()
select new
{
= x.Field<string>("PipelineComponentCode"),
= x.Field<string>("BoxNumber"),
= ConvertState(x.Field<object>("State")),
= ConvertProductionState(x.Field<object>("ProductionState")),
线 = x.Field<DateTime?>("PlanStartDate"),
= x.Field<string>("DrawingName"),
= x.Field<string>("PersonName"),
= x.Field<DateTime?>("ReceiveDate"),
});
{
= x.Field<string>("PipelineComponentCode"),
= x.Field<string>("BoxNumber"),
= ConvertState(x.Field<object>("State")),
= ConvertProductionState(x.Field<object>("ProductionState")),
线 = x.Field<DateTime?>("PlanStartDate"),
= x.Field<string>("DrawingName"),
= x.Field<string>("PersonName"),
= x.Field<DateTime?>("ReceiveDate"),
});
string path = Funs.RootPath + @"File\Excel\Temp\PrePipeline.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
@@ -704,7 +701,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
File.Delete(path);
}
}
}
@@ -73,7 +73,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
pipeline.AssembleUnit = this.drpAssembleUnit.SelectedValue;
}
pipeline.BoxNumber = this.txtBoxNumber.Text.Trim();
pipeline.PipelineId = hdPipelineId.Text;
pipeline.PipelineId = hdPipelineId.Text;
BLL.HJGL_PipelineComponentService.AddPipelineComponent(pipeline);
}
}
@@ -1,11 +1,8 @@
using BLL;
using MiniExcelLibs;
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
@@ -65,7 +62,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
Pipeline_ComponentList.Clear();
}
errorInfos = string.Empty;
}
}
#endregion
@@ -130,11 +127,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
// var rows =Funs.LINQToDataTable(MiniExcel.Query(fileName).ToList()) ;
// var rows =Funs.LINQToDataTable(MiniExcel.Query(fileName).ToList()) ;
var rows = MiniExcel.QueryAsDataTable(fileName, useHeaderRow: true);
Model.ResponeData responeData = new Model.ResponeData();
responeData = AddDatasetToSQL(rows, 3);
if (responeData.code==1)
if (responeData.code == 1)
{
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
}
@@ -164,7 +161,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
Model.ResponeData responeData = new Model.ResponeData();
//string result = string.Empty;
List<string> result = new List<string> () ;
List<string> result = new List<string>();
int ic, ir;
ic = pds.Columns.Count;
ir = pds.Rows.Count;
@@ -198,7 +195,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (pipeline == null)
{
//result += "第" + (i + 2).ToString() + "行," + "不存在此管线号" + "|";
result.Add("不存在此管线号-"+ pipelinecode);
result.Add("不存在此管线号-" + pipelinecode);
continue;
}
}
@@ -217,13 +214,13 @@ namespace FineUIPro.Web.HJGL.PreDesign
continue;
}
}
}
if (result.Count>0)
}
if (result.Count > 0)
{
PipelineList.Clear();
// result = result.Substring(0, result.LastIndexOf("|"));
errorInfos = string .Join("|", result.Distinct()) ;
// result = result.Substring(0, result.LastIndexOf("|"));
errorInfos = string.Join("|", result.Distinct());
//Alert alert = new Alert();
//alert.Message = result;
//alert.Target = Target.Self;
@@ -235,23 +232,24 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
var dt = pds.AsEnumerable()
.GroupBy(x => new {
.GroupBy(x => new
{
pipelinecode = x.Field<string>("管线号"),
PipelineComponentCode = x.Field<string>("预制组件"),
// DrawingName = x.Field<string>("预制图纸名称"),
// DrawingName = x.Field<string>("预制图纸名称"),
})
.Select(x => new
{
pipelinecode = x.Key.pipelinecode,
PipelineComponentCode = x.Key.PipelineComponentCode,
// DrawingName = x.Key.DrawingName,
// DrawingName = x.Key.DrawingName,
QRCode = String.Join(";", x.Select(z => z.Field<string>("二维码信息")))
});
foreach (var item in dt)
{
var pipeline = PipelineService.GetPipelineByPipelineCode(this.CurrUser.LoginProjectId,item.pipelinecode.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""));
var hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(item.PipelineComponentCode.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""), pipeline.PipelineId);
if (hJGL_Pipeline_Component!=null)
var pipeline = PipelineService.GetPipelineByPipelineCode(this.CurrUser.LoginProjectId, item.pipelinecode.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""));
var hJGL_Pipeline_Component = HJGL_PipelineComponentService.GetPipelineComponentByCodeandpipelineId(item.PipelineComponentCode.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", ""), pipeline.PipelineId);
if (hJGL_Pipeline_Component != null)
{
//model.Pipeline_ComponentQRCodeRootName rootName = new model.Pipeline_ComponentQRCodeRootName();
//rootName.QRCode = new List<model.Pipeline_ComponentQRCodeQRCodeItem>();
@@ -267,9 +265,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
hJGL_Pipeline_Component.QRCode = item.QRCode;
Pipeline_ComponentList.Add(hJGL_Pipeline_Component);
}
}
errorInfos = string.Empty;
@@ -345,10 +343,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
var joint = BLL.WeldJointService.GetWeldJointsByWeldJointCode(item.PipelineId, QRCodeitem.Substring(1));
if (joint != null)
{
var ComponetJoint = BLL.HJGL_PipelineComponentjointService.GetHJGL_Pipeline_ComponentJointByWeldJointId(joint.WeldJointId);
if (ComponetJoint!=null)
var ComponetJoint = BLL.HJGL_PipelineComponentjointService.GetHJGL_Pipeline_ComponentJointByWeldJointId(joint.WeldJointId);
if (ComponetJoint != null)
{
ComponetJoint.PipelineComponentCode= item.PipelineComponentCode;
ComponetJoint.PipelineComponentCode = item.PipelineComponentCode;
ComponetJoint.PipelineComponentId = item.PipelineComponentId;
HJGL_PipelineComponentjointService.UpdateHJGL_Pipeline_ComponentJoint(ComponetJoint);
}
@@ -359,12 +357,12 @@ namespace FineUIPro.Web.HJGL.PreDesign
hJGL_Pipeline_ComponentJoint.PipelineComponentCode = item.PipelineComponentCode;
hJGL_Pipeline_ComponentJoint.PipelineComponentId = item.PipelineComponentId;
hJGL_Pipeline_ComponentJoint.WeldJointCode = joint.WeldJointCode;
hJGL_Pipeline_ComponentJoint.WeldJointId=joint.WeldJointId;
hJGL_Pipeline_ComponentJoint.WeldJointId = joint.WeldJointId;
hJGL_Pipeline_ComponentJoint.State = 0;
HJGL_PipelineComponentjointService.AddHJGL_Pipeline_ComponentJoint(hJGL_Pipeline_ComponentJoint);
}
}
}
}
@@ -1,22 +1,12 @@
using BLL;
using FineUIPro.Web.ProjectData;
using MiniExcelLibs;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Bcpg.OpenPgp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Web;
using System.Web.WebSockets;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -1,11 +1,6 @@
using BLL;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -43,7 +38,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
Model.HJGL_TrainNumberManage model = BLL.TrainNumberManageService.GetModelById(this.Id);
if (model != null)
{
this.txtTrainNumber.Text = model.TrainNumber;
this.txtTrainNumber.Text = model.TrainNumber;
this.txtDriverName.Text = model.DriverName;
this.txtDriverPhone.Text = model.DriverPhone;
this.txtLicensePlateNumber.Text = model.LicensePlateNumber;
@@ -76,7 +76,7 @@
FieldType="String" HeaderText="联系人电话" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="110px" ColumnID="ReceiveDate" DataField="ReceiveDate" FieldType="String"
HeaderText="收时间" HeaderTextAlign="Center" TextAlign="Center">
HeaderText="收时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center">
@@ -6,15 +6,12 @@ using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class TrainNumberManager : PageBase
{
public static List<Model.HJGL_TrainNumberManage> hJGL_TrainNumberManages=new List<Model.HJGL_TrainNumberManage>();
public partial class TrainNumberManager : PageBase
{
public static List<Model.HJGL_TrainNumberManage> hJGL_TrainNumberManages = new List<Model.HJGL_TrainNumberManage>();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
@@ -34,11 +31,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
Model.HJGL_TrainNumberManage table = new Model.HJGL_TrainNumberManage();
table.ProjectId = this.CurrUser.LoginProjectId;
var tb = BLL.TrainNumberManageService.GetListByQueryModle(table, Grid1.PageIndex,Grid1.PageSize);
Grid1.RecordCount = tb.Total;
var tb = BLL.TrainNumberManageService.GetListByQueryModle(table, Grid1.PageIndex, Grid1.PageSize);
Grid1.RecordCount = tb.Total;
Grid1.DataSource = tb.Data;
Grid1.DataBind();
hJGL_TrainNumberManages= tb.Data;
hJGL_TrainNumberManages = tb.Data;
}
#endregion
@@ -220,7 +217,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
MiniExcel.SaveAs(path, q);
string fileName = $"车次管理-"+ string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx";
string fileName = $"车次管理-" + string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
@@ -299,12 +296,12 @@ namespace FineUIPro.Web.HJGL.PreDesign
DataTable tb = LINQToDataTable(HJGLPackagingmanageService.GetPackagingManage(Id));
if (tb.Rows.Count > 0)
{
var model = TrainNumberManageService.GetModelById(Id);
var model = TrainNumberManageService.GetModelById(Id);
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("ProjectName", ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId));
keyValuePairs.Add("TrainNumber", model.TrainNumber);
keyValuePairs.Add("Remark", model.Remark);
keyValuePairs.Add("ContactName", model.ContactName );
keyValuePairs.Add("ContactName", model.ContactName);
keyValuePairs.Add("ContactPhone", model.ContactPhone);
keyValuePairs.Add("ID", "TrainNumberManager$" + model.Id);
DataRow dataRow = tb.NewRow();
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -1,10 +1,6 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -44,7 +40,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
private void BindGrid()
{
var result = HJGLPackagingmanageService.GetPackagingManage(TrainNumberId);
var result = HJGLPackagingmanageService.GetPackagingManage(TrainNumberId);
Grid1.RecordCount = result.Count();
Grid1.DataSource = result;
Grid1.DataBind();
@@ -3,9 +3,7 @@ using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.DataVisualization.Charting;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -51,19 +49,19 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
private void Bind()
{
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
{
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningById( tvControlItem.SelectedNodeID);
this.imgPhoto.ImageUrl = null;
if (unit != null)
{
this.imgPhoto.ImageUrl = "~/" + unit.FlowChartPic;
}
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
{
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningById(tvControlItem.SelectedNodeID);
this.imgPhoto.ImageUrl = null;
if (unit != null)
{
this.imgPhoto.ImageUrl = "~/" + unit.FlowChartPic;
}
}
}
#region --
/// <summary>
@@ -111,8 +109,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
if (unitWork1.Count() > 0)
@@ -138,17 +136,17 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
foreach (var q in unitWork2)
{
int a = (from x in Funs.DB.HJGL_YardPlanning where x.SurperId==q.UnitWorkId select x).Count();
int a = (from x in Funs.DB.HJGL_YardPlanning where x.SurperId == q.UnitWorkId select x).Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
// tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn2.Text = q.UnitWorkName ;
// tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn2.Text = q.UnitWorkName;
tn2.CommandName = "主项";
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.EnableClickEvent = true;
rootNode2.Nodes.Add(tn2);
if (a>0)
if (a > 0)
{
BoundTree(tn2.Nodes, tn2.NodeID);
}
@@ -159,7 +157,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
private void BoundTree(TreeNodeCollection nodes, string superId)
{
var mdoel = BLL.HJGL_YardPlanningService.GetHJGL_YardPlanningBySurperId(superId);
foreach (var m in mdoel)
foreach (var m in mdoel)
{
TreeNode chidNode = new TreeNode
{
@@ -167,12 +165,12 @@ namespace FineUIPro.Web.HJGL.PreDesign
NodeID = m.YardPlanningId,
Expanded = true,
Selectable = true,
EnableClickEvent= true,
};
EnableClickEvent = true,
};
nodes.Add(chidNode);
this.BoundTree(chidNode.Nodes, m.YardPlanningId);
}
}
#endregion
@@ -226,11 +224,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
{
var model = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
if (model != null)
{
HJGL_YardPlanningService.DeleteHJGL_YardPlanningById(model.YardPlanningId);
}
this.imgPhoto.ImageUrl = null;
if (model != null)
{
HJGL_YardPlanningService.DeleteHJGL_YardPlanningById(model.YardPlanningId);
}
this.imgPhoto.ImageUrl = null;
}
else
{
@@ -245,37 +243,37 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (filePhoto.HasFile)
{
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
if (string.IsNullOrEmpty(rootUrl))
{
rootUrl = Funs.RootPath;
}
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
if (string.IsNullOrEmpty(rootUrl))
{
rootUrl = Funs.RootPath;
}
string fileName = filePhoto.ShortFileName;
string fileName = filePhoto.ShortFileName;
if (!ValidateFileType(fileName))
{
// 清空文件上传控件
if (!ValidateFileType(fileName))
{
// 清空文件上传控件
filePhoto.Reset();
ShowNotify("无效的文件类型!");
return;
}
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
filePhoto.SaveAs(rootUrl + "/FileUpload/HJGL_YardPlanning/" + fileName);
imgPhoto.ImageUrl = "~/FileUpload/HJGL_YardPlanning/" + fileName;
HJGL_YardPlanningService.SavePic(tvControlItem.SelectedNodeID, "FileUpload/HJGL_YardPlanning/" + fileName);
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
filePhoto.Reset();
ShowNotify("无效的文件类型!");
return;
}
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
filePhoto.SaveAs(rootUrl + "/FileUpload/HJGL_YardPlanning/" + fileName);
imgPhoto.ImageUrl = "~/FileUpload/HJGL_YardPlanning/" + fileName;
HJGL_YardPlanningService.SavePic( tvControlItem.SelectedNodeID, "FileUpload/HJGL_YardPlanning/" + fileName);
// 清空文件上传组件(上传后要记着清空,否则点击提交表单时会再次上传!!)
filePhoto.Reset();
}
}
else
{
@@ -323,7 +321,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
{
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningById( tvControlItem.SelectedNodeID);
var unit = HJGL_YardPlanningService.GetHJGL_YardPlanningById(tvControlItem.SelectedNodeID);
this.imgPhoto.ImageUrl = null;
if (unit != null)
{
@@ -339,13 +337,13 @@ namespace FineUIPro.Web.HJGL.PreDesign
#endregion
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID)&& tvControlItem.SelectedNode.CommandName!="主项")
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID) && tvControlItem.SelectedNode.CommandName != "主项")
{
var model = HJGL_YardPlanningService.GetHJGL_YardPlanningById( tvControlItem.SelectedNodeID);
var model = HJGL_YardPlanningService.GetHJGL_YardPlanningById(tvControlItem.SelectedNodeID);
if (model == null)
{
HJGL_YardPlanningService.SavePic( tvControlItem.SelectedNodeID, "");
// model = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
HJGL_YardPlanningService.SavePic(tvControlItem.SelectedNodeID, "");
// model = HJGL_YardPlanningService.GetHJGL_YardPlanningByProjectId(this.CurrUser.LoginProjectId, tvControlItem.SelectedNodeID);
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HJGL_YardPlanning&menuId={1}", model.YardPlanningId, BLL.Const.HJGL_YardPlanningMenuId)));
}
@@ -1,10 +1,5 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -23,14 +18,14 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
if (!IsPostBack)
{
YardPlanningId=Request.Params["YardPlanningId"];
string Type= Request.Params["Type"];
YardPlanningId = Request.Params["YardPlanningId"];
string Type = Request.Params["Type"];
if (!string.IsNullOrEmpty(Type))
{
if (Type=="Edit")
if (Type == "Edit")
{
var q = BLL.HJGL_YardPlanningService.GetHJGL_YardPlanningById(YardPlanningId);
txtYardPlanName.Text = q.YardPlanName;
@@ -64,7 +59,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
else if (Type == "Edit")
{
var q = BLL.HJGL_YardPlanningService.GetHJGL_YardPlanningById(YardPlanningId);
q.YardPlanName=txtYardPlanName.Text ;
q.YardPlanName = txtYardPlanName.Text;
HJGL_YardPlanningService.UpdateHJGL_YardPlanning(q);
}
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());