包装管理修改
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -34,27 +35,26 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
drpTypeInt.DataBind();
|
||||
|
||||
|
||||
BindGrid();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
if (!string.IsNullOrEmpty(PackagingManageId))
|
||||
{
|
||||
var model = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
|
||||
drpTypeInt.Enabled = false;
|
||||
txtPackagingCode.Text = model.PackagingCode;
|
||||
dropPipelineComponentCode.Values = model.PipelineComponentId?.Split(',');
|
||||
txtStackingPosition.Text = model.StackingPosition;
|
||||
drpTrainNumber.SelectedValue = model.TrainNumberId;
|
||||
drpTypeInt.SelectedValue = model.TypeInt.ToString();
|
||||
BindGrid2(this.PackagingManageId);
|
||||
if (model.State== HJGL_PackagingmanageService.state_0)
|
||||
{
|
||||
btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
drpTypeInt.Enabled = true;
|
||||
btnSave.Hidden = false;
|
||||
txtPackagingCode.Text = ProjectService.GetProjectCodeByProjectId(this.CurrUser.LoginProjectId)+"-"+ string.Format("{0:yyyyMMdd}", DateTime.Now)+"-";
|
||||
|
||||
txtPackagingCode.Text = HJGL_PackagingmanageService.GetNewPackagingCode(this.CurrUser.LoginProjectId);
|
||||
}
|
||||
drpTypeInt_SelectedIndexChanged(null, null);
|
||||
}
|
||||
@@ -70,25 +70,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
|
||||
private void BindGrid2(string PackagingManageId)
|
||||
{
|
||||
Grid2.DataSource = PackagingmanagedetailService.GetPackagingData(PackagingManageId);
|
||||
Grid2.DataSource = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId);
|
||||
Grid2.DataBind();
|
||||
}
|
||||
|
||||
//protected void drpPipelineComponentCode_SelectedIndexChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// if (!string .IsNullOrEmpty(drpPipelineComponentCode.SelectedValue))
|
||||
// {
|
||||
// var model_Component = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(drpPipelineComponentCode.SelectedValue);
|
||||
// var model_pipe=BLL.PipelineService.GetPipelineByPipelineId(model_Component.PipelineId);
|
||||
// txtPlanStartDate.Text= model_Component.PlanStartDate.ToString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// txtPlanStartDate.Text =String.Empty;
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -112,7 +96,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
//table.ContactPhone = txtContactPhone.Text;
|
||||
table.TrainNumberId = drpTrainNumber.SelectedValue;
|
||||
table.TypeInt = int.Parse(drpTypeInt.SelectedValue);
|
||||
if (drpTypeInt.SelectedValue == HJGL_PackagingmanageService.TypeInt.预制组件.ToString())
|
||||
if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.预制组件).ToString())
|
||||
{
|
||||
table.PipelineComponentId = string.Join(",", dropPipelineComponentCode.Values);
|
||||
|
||||
@@ -134,7 +118,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
//table.ContactPhone =txtContactPhone.Text;
|
||||
table.TrainNumberId = drpTrainNumber.SelectedValue;
|
||||
table.TypeInt = int.Parse(drpTypeInt.SelectedValue);
|
||||
if (drpTypeInt.SelectedValue == HJGL_PackagingmanageService.TypeInt.预制组件.ToString())
|
||||
if (drpTypeInt.SelectedValue ==((int)HJGL_PackagingmanageService.TypeInt.预制组件).ToString())
|
||||
{
|
||||
table.PipelineComponentId = string.Join(",", dropPipelineComponentCode.Values);
|
||||
|
||||
@@ -142,6 +126,29 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
}
|
||||
BLL.HJGL_PackagingmanageService.UpdateHJGL_PackagingManage(table);
|
||||
}
|
||||
SaveDetail();
|
||||
}
|
||||
|
||||
private void SaveDetail()
|
||||
{
|
||||
|
||||
//根据列表中的明细项添加
|
||||
List<Model.PipelinePrefabricatedComponentsItem> detailLists = new List<Model.PipelinePrefabricatedComponentsItem>();
|
||||
JArray teamGroupData = Grid2.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
string id = teamGroupRow.Value<string>("id");
|
||||
|
||||
var mdoel = HJGLPackagingmanagedetailService.GetModelById(id);
|
||||
if (mdoel != null)
|
||||
{
|
||||
mdoel.Number = values.Value<decimal>("Number");
|
||||
}
|
||||
HJGLPackagingmanagedetailService.Update(mdoel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void btnFind_Click1(object sender, EventArgs e)
|
||||
@@ -175,25 +182,34 @@ namespace FineUIPro.Web.HJGL.PreDesign
|
||||
{
|
||||
dropPipelineComponentCode.Hidden=false;
|
||||
Grid2.Hidden=true;
|
||||
BindGrid();
|
||||
}
|
||||
else if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.预制散件).ToString())
|
||||
{
|
||||
dropPipelineComponentCode.Hidden = true;
|
||||
Grid2.Hidden = false;
|
||||
btnSelect.Hidden = false;
|
||||
btnSelectStock.Hidden = true;
|
||||
BindGrid2(this.PackagingManageId);
|
||||
|
||||
}
|
||||
else if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.其他材料).ToString())
|
||||
{
|
||||
dropPipelineComponentCode.Hidden = true;
|
||||
Grid2.Hidden = false;
|
||||
btnSelect.Hidden = true;
|
||||
btnSelectStock.Hidden = false;
|
||||
BindGrid2(this.PackagingManageId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "delete")
|
||||
{
|
||||
string id = e.RowID;
|
||||
PackagingmanagedetailService.DeleteById(id);
|
||||
HJGLPackagingmanagedetailService.DeleteById(id);
|
||||
BindGrid2(this.PackagingManageId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user