焊接管理修改
This commit is contained in:
@@ -32,40 +32,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
// string strSql = @"select pack.PackagingManageId,
|
||||
// pack.PackagingCode,
|
||||
// com.PipelineComponentCode,
|
||||
// unit.UnitWorkName,
|
||||
// pipe.PlanStartDate,
|
||||
// pack.ProjectId,
|
||||
// pack.StackingPosition,
|
||||
// pack.State,
|
||||
// pack.ContactName,
|
||||
// pack.ContactPhone,
|
||||
//pack.ReceiveDate,
|
||||
//person.PersonName
|
||||
// from HJGL_PackagingManage as pack
|
||||
// left join HJGL_Pipeline_Component com on com.PipelineComponentId=pack.PipelineComponentId
|
||||
// left join HJGL_Pipeline pipe on pipe.PipelineId =com.PipelineId
|
||||
// left join WBS_UnitWork unit on pipe.UnitWorkId=unit.UnitWorkId
|
||||
// left join Person_Persons person on pack.ReceiveMan=person.PersonId
|
||||
// WHERE pack.ProjectId = @ProjectId ";
|
||||
// List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
// listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
// if (!string.IsNullOrEmpty(this.txtPackagingCode.Text.Trim()))
|
||||
// {
|
||||
// strSql += " AND pack.PackagingCode LIKE @PackagingCode";
|
||||
// listStr.Add(new SqlParameter("@PackagingCode", "%" + this.txtPackagingCode.Text.Trim() + "%"));
|
||||
// }
|
||||
// SqlParameter[] parameter = listStr.ToArray();
|
||||
// DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
//Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
//var table = this.GetPagedDataTable(Grid1, tb);
|
||||
//Grid1.DataSource = table;
|
||||
//Grid1.DataBind();
|
||||
{
|
||||
var list = BLL.HJGL_PackagingmanageService.GetPackagingManageList(this.CurrUser.LoginProjectId, this.txtPackagingCode.Text.Trim(), this.Grid1.PageIndex, this.Grid1.PageSize);
|
||||
Grid1.RecordCount = list.Total;
|
||||
Grid1.DataSource = list.Data;
|
||||
@@ -341,7 +308,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(Id);
|
||||
DataTable tb = LINQToDataTable(BLL.HJGL_PackagingmanageService.GetPackagingDetailById(Id));
|
||||
if (tb.Rows.Count > 0)
|
||||
{
|
||||
var model = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(Id);
|
||||
|
||||
@@ -47,7 +47,12 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
var pack = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
|
||||
if (pack == null) return;
|
||||
if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制组件)
|
||||
var detailList= HJGL_PackagingmanageService.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);
|
||||
|
||||
@@ -73,9 +78,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
Grid1.RecordCount = detailList.Count();
|
||||
Grid1.DataSource = detailList;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
<f:RenderField Width="150px" ColumnID="ContactPhone" DataField="ContactPhone" SortField="ContactPhone"
|
||||
FieldType="String" HeaderText="联系人电话" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="ReceiveDate" DataField="ReceiveDate" FieldType="String"
|
||||
HeaderText="接收时间" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
|
||||
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using BLL;
|
||||
using MiniExcelLibs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
@@ -11,7 +14,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
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)
|
||||
@@ -35,6 +38,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
Grid1.RecordCount = tb.Total;
|
||||
Grid1.DataSource = tb.Data;
|
||||
Grid1.DataBind();
|
||||
hJGL_TrainNumberManages= tb.Data;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -187,7 +191,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
/// 导出按钮
|
||||
@@ -196,17 +200,39 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
/// <param name="e"></param>
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("发货管理" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = 500;
|
||||
this.BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
if (hJGL_TrainNumberManages != null)
|
||||
{
|
||||
var q = hJGL_TrainNumberManages
|
||||
.Select((x, index) => new
|
||||
{
|
||||
序号 = index + 1, // 自增序号,从 1 开始
|
||||
车次 = x.TrainNumber,
|
||||
驾驶员姓名 = x.DriverName,
|
||||
驾驶员电话 = x.DriverPhone,
|
||||
车牌号 = x.LicensePlateNumber,
|
||||
联系人姓名 = x.ContactName,
|
||||
联系人电话 = x.ContactPhone,
|
||||
备注 = x.Remark
|
||||
});
|
||||
|
||||
string path = Funs.RootPath + @"File\Excel\Temp\TrainNumberManager.xlsx";
|
||||
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx");
|
||||
|
||||
MiniExcel.SaveAs(path, q);
|
||||
|
||||
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();
|
||||
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
|
||||
System.Web.HttpContext.Current.Response.Flush();
|
||||
System.Web.HttpContext.Current.Response.Close();
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
@@ -257,17 +283,50 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
protected void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
|
||||
string Id = this.Grid1.SelectedRowID;
|
||||
Pring(Id);
|
||||
}
|
||||
|
||||
private void Pring(string Id)
|
||||
{
|
||||
BLL.FastReportService.ResetData();
|
||||
if (string.IsNullOrEmpty(Id))
|
||||
{
|
||||
string id = Grid1.SelectedRowID;
|
||||
string url = "TrainNumberManagerPrint.aspx?TrainNumberId={0}";
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format(url, id, "打印 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择要打印的数据", MessageBoxIcon.Warning);
|
||||
|
||||
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
DataTable tb = LINQToDataTable(HJGL_PackagingmanageService.GetPackagingManage(Id));
|
||||
if (tb.Rows.Count > 0)
|
||||
{
|
||||
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("ContactPhone", model.ContactPhone);
|
||||
keyValuePairs.Add("ID", "TrainNumberManager$" + model.Id);
|
||||
DataRow dataRow = tb.NewRow();
|
||||
dataRow["PackagingCode"] = "合计:" + tb.Rows.Count;
|
||||
tb.Rows.Add(dataRow);
|
||||
if (tb != null)
|
||||
{
|
||||
tb.TableName = "Data";
|
||||
}
|
||||
BLL.FastReportService.AddFastreportTable(tb);
|
||||
BLL.FastReportService.AddFastreportParameter(keyValuePairs);
|
||||
string initTemplatePath = "";
|
||||
string rootPath = Server.MapPath("~/");
|
||||
initTemplatePath = "File\\Fastreport\\发货单.frx";
|
||||
|
||||
if (File.Exists(rootPath + initTemplatePath))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user