焊接材料管理修改

This commit is contained in:
2024-09-28 16:59:44 +08:00
parent 4686441406
commit a7205a984d
35 changed files with 924 additions and 152 deletions
@@ -88,19 +88,22 @@ namespace FineUIPro.Web.CLGL
txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
}
drpTypeInt_SelectedIndexChanged(null, null);
}
}
private void InitDrpList()
{
drpWarehouse.DataTextField = "Text";
drpWarehouse.DataValueField = "Value";
drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode();
drpWarehouse.DataBind();
string[] typeIntArr = { TwConst.TypeInt..ToString(), TwConst.TypeInt..ToString() };
drpTypeInt.DataTextField = "Key";
drpTypeInt.DataValueField = "Value";
drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("散件出库")); ;
drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => typeIntArr.Contains(x.Key));
drpTypeInt.DataBind();
UnitService.InitUnitDropDownList(drpReqUnit, this.CurrUser.LoginProjectId, true);
@@ -112,11 +115,23 @@ namespace FineUIPro.Web.CLGL
}
private void BindGrid(string inOutPlanMasterId)
{
var queryRelationModel = new Tw_InOutPlanDetail_Relation();
queryRelationModel.InOutPlanMasterId = Id;
var tb = TwInoutplandetailRelationService.GetListData(queryRelationModel, Grid1);
Grid1.DataSource = tb;
Grid1.DataBind();
if (drpTypeInt.SelectedValue == ((int)TwConst.TypeInt.).ToString())
{
var queryRelationModel = new Tw_InOutPlanDetail_Relation();
queryRelationModel.InOutPlanMasterId = Id;
var tb = TwInoutplandetailRelationService.GetListData(queryRelationModel, Grid1);
Grid1.DataSource = tb;
Grid1.DataBind();
}
else
{
var queryRelationModel = new Tw_InOutDetailOutput();
queryRelationModel.InOutPlanMasterId = Id;
var tb = TwInOutplandetailService.GetListData(queryRelationModel, Grid1);
Grid2.DataSource = tb;
Grid2.DataBind();
}
}
#region
@@ -130,6 +145,12 @@ namespace FineUIPro.Web.CLGL
Save(Const.BtnSave);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterSelect.aspx?UnitWorkId={0}&Id={1}",UnitWorkId,Id, "选择- ")));
}
protected void btnSelectStock_Click(object sender, EventArgs e)
{
Save(Const.BtnSave);
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterSelectStock.aspx?UnitWorkId={0}&Id={1}", UnitWorkId, Id, "选择- ")));
}
#endregion
@@ -198,15 +219,23 @@ namespace FineUIPro.Web.CLGL
model.State = state;
TwInOutplanmasterService.Update(model);
}
SaveDetail();
if (drpTypeInt.SelectedValue == ((int)TwConst.TypeInt.).ToString())
{
SaveDetail_Relation();
}
else
{
SaveDetail();
}
}
/// <summary>
/// 保存明细项
/// </summary>
private void SaveDetail()
private void SaveDetail_Relation()
{
//根据列表中的明细项添加
List<Model.Tw_InOutPlanDetail_Relation> detailLists = new List<Model.Tw_InOutPlanDetail_Relation>();
JArray teamGroupData = Grid1.GetMergedData();
@@ -226,7 +255,27 @@ namespace FineUIPro.Web.CLGL
TwInOutplandetailService.GenInOutPlanDetailByInoutPlanMasterId(Id);
}
private void SaveDetail()
{
//根据列表中的明细项添加
List<Model.Tw_InOutPlanDetail> detailLists = new List<Model.Tw_InOutPlanDetail>();
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 = TwInOutplandetailService.GetById(id);
if (mdoel != null)
{
mdoel.PlanNum = values.Value<decimal>("PlanNum");
}
TwInOutplandetailService.Update(mdoel);
}
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "delete" )
@@ -237,10 +286,33 @@ namespace FineUIPro.Web.CLGL
BindGrid(Id);
}
}
protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "delete")
{
string id = e.RowID;
TwInOutplandetailService.DeleteById(id);
BindGrid(Id);
}
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid(Id);
}
protected void drpTypeInt_SelectedIndexChanged(object sender, EventArgs e)
{
if (drpTypeInt.SelectedValue ==((int)TwConst.TypeInt.).ToString())
{
Grid1.Hidden=false;
Grid2.Hidden=true;
}
else
{
Grid1.Hidden = true;
Grid2.Hidden = false;
}
}
}
}