| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using CoreFS.CA06;using Pur.Entity;
- using Pur.Entity.configureEntity;
- using Core.Mes.Client.Comm.Control;
- using com.hnshituo.pur.vo;
- using Core.Mes.Client.Comm.Tool;
- using Pur.PublicTools;
- using Core.Mes.Client.Comm.Server;
- using System.Collections;
- namespace Pur.configure
- {
- public partial class FrmActualSeat : FrmPmsBase
- {
- public FrmActualSeat()
- {
- InitializeComponent();
- }
- private void FrmActualSeat_Load(object sender, EventArgs e)
- {
- GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0],new string[]{});
- GridHelper.SetExcludeColumnsActive(ultraGrid2.DisplayLayout.Bands[0], new string[] { });
- GridHelper.SetExcludeColumnsActive(ultraGrid2.DisplayLayout.Bands[0], new string[] { });
- DataTable dt1 = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1230" }, this.ob);
- if (dt1.Rows.Count > 0)
- {
- dt1.DefaultView.Sort = "BASENAME";
- dt1 = dt1.DefaultView.ToTable();
- }
- publicPms.FilComboboxAdd(txt_costCenter, dt1, "baseCode", "baseName", "validflag NOT in ('0')", true, "/", "");
- txt_costCenter.SelectedIndex = -1;
- GetQureyPhysicWH();
- }
- #region toolbar工具区
- public override void ToolBar_Click(object sender, string ToolBarKey)//toolbar
- {
- switch (ToolBarKey)
- {
- case "Query"://查询物理库区数据
- GetQureyPhysicWH();
- //GetQueryPhysicWH();
- break;
- case "Add"://增加
- if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
- {
- AddPhysicWH();
- }
- else if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
- {
- AddPos();
- }
- else if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[2])
- {
- AddMan();
- }
- else
- {
- MessageUtil.ShowTips("请选择编辑区对应的库区、库位、负责人窗口进行操作");
- }
- break;
- case "Update"://修改
- if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
- {
- EditPhysicWH();
- }
- else
- {
- MessageUtil.ShowTips("库位、负责人窗口无法修改,或请重新添加");
- }
- break;
- case "Delete"://删除
- if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[0])
- {
- DeletePhysicWH();
- }
- else if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[1])
- {
- DeletePosWH();
- }
- else if (ultraTabControl1.SelectedTab == ultraTabControl1.Tabs[2])
- {
- DeleteManWH();
- }
- else
- {
- MessageUtil.ShowTips("请选择编辑区对应的库区、库位、负责人窗口进行操作");
- }
- break;
- case "exit"://关闭窗口
- this.Close();
- break;
- case "doexcl":
- this.doExcel();
- break;
- }
- }
- private void doExcel()
- {
- try
- {
- this.Cursor = Cursors.Default;
- ArrayList alUltraGrid = new ArrayList();
- alUltraGrid.Add(ultraGrid1);
- ArrayList alSheeft = new ArrayList();
- alSheeft.Add("物理库区信息");
- if (ultraGrid1.Rows.Count > 0)
- {
- GridHelper.ulGridToExcel(alUltraGrid, alSheeft, "物理库区信息表");//导出excel
- }
- else
- {
- MessageUtil.ShowTips("无可导出明细!");
- }
- }
- catch (Exception e)
- {
- MessageUtil.ShowTips("导出失败" + e.Message);
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- /// <summary>
- /// 查询物理库区信息
- /// </summary>
- private void GetQureyPhysicWH()// 查询物理库区信息
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- cleanArea();
- dataSet1.Clear();
- dataSet2.Clear();
- dataSet3.Clear();
- PhysicSeatEntity Phouse = new PhysicSeatEntity();
- Phouse.Validflag = "1";
- Phouse.InvPhysic = tbxPhysicQ.Text.ToString().Trim();
- Phouse.InvPhysicName = tbxPhysicNameQ.Text.ToString().Trim();
- Phouse.OrgName = tbx_orgNameQ.Text.Trim();
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.ActualSeatService", "getActualSeat", new object[] { Phouse, 0, 0 });
- if (dt != null)
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("查询失败:" + ex.Message);
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- /// <summary>
- /// 删除物理库存区信息
- /// </summary>
- private void DeletePhysicWH()// 删除物理库存区信息
- {
- try
- {
- if (ultraGrid1.ActiveRow != null)
- {
- String StrPhysic = ultraGrid1.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- if (MessageBox.Show("删除编号为[" + StrPhysic + "]的物理库区?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- PhysicSeatEntity Phouse = new PhysicSeatEntity();
- Phouse.InvPhysic = StrPhysic;
- Phouse.Validflag = "0";
- Phouse.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- Phouse.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- Phouse.DeleteTime = DateTime.Now;
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ActualSeatService", "doUpdate", new object[] { Phouse, 0, 0 });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("删除成功", "提示");
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "invPhysic", StrPhysic);
- }
- else
- {
- MessageBox.Show("删除失败:" + result.Resultmsg);
- }
- }
- }
- else
- {
- MessageBox.Show("请选择一条需要删除的库区信息行", "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("删除失败:" + ex.Message,"提示");
- }
- }
- /// <summary>
- /// 删除物理库存区信息
- /// </summary>
- private void DeletePosWH()// 删除物理库存区信息
- {
- try
- {
- if (ultraGrid2.ActiveRow != null)
- {
- String StrPhysic = ultraGrid2.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- String StrPos = ultraGrid2.ActiveRow.Cells["invPos"].Value.ToString().Trim();
- String StrPosName = ultraGrid2.ActiveRow.Cells["invPosName"].Value.ToString().Trim();
- String StrId = ultraGrid2.ActiveRow.Cells["id"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(StrId))
- {
- MessageUtil.ShowTips("未获取该行主键,请刷新界面重试");
- return;
- }
- if (String.IsNullOrEmpty(StrPhysic))
- {
- MessageUtil.ShowTips("未获取到库区编码,请刷新界面重试");
- return;
- }
- if (MessageBox.Show("移除库区[" + StrPhysic + "]的库位[" + StrPosName + "]?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- ActualSeatPosEntity PosEntity = new ActualSeatPosEntity();
- PosEntity.Id = StrId;
- PosEntity.InvPos = StrPos;
- PosEntity.Validflag = "0";
- PosEntity.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- PosEntity.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- PosEntity.DeleteTime = DateTime.Now;
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ActualSeatPosService", "doUpdate", new object[] { PosEntity, 0, 0 });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("移除成功", "提示");
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "invPhysic", StrPhysic);
- }
- else
- {
- MessageBox.Show("移除失败"+result.Resultmsg,"提示");
- }
- }
- }
- else
- {
- MessageBox.Show("请选择一条需要删除的库位信息行", "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("删除失败:" + ex.Message,"提示");
- }
- }
- /// <summary>
- /// 删除物理库存区信息
- /// </summary>
- private void DeleteManWH()// 删除物理库存区信息
- {
- try
- {
- if (ultraGrid3.ActiveRow != null)
- {
- {
- String StrPhysic = ultraGrid3.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- String StrUserId = ultraGrid3.ActiveRow.Cells["userId"].Value.ToString().Trim();
- String StruserName = ultraGrid3.ActiveRow.Cells["userName"].Value.ToString().Trim();
- String StrId = ultraGrid3.ActiveRow.Cells["id"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(StrId))
- {
- MessageUtil.ShowTips("未获取该行主键,请刷新界面重试");
- return;
- }
- if (String.IsNullOrEmpty(StrPhysic))
- {
- MessageUtil.ShowTips("未获取到库区编码,请刷新界面重试");
- return;
- }
- if (MessageBox.Show("移除库区[" + StrPhysic + "]的负责人[" + StruserName + "]?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
- {
- ManRelationEntity ManReEntity = new ManRelationEntity();
- ManReEntity.Id = StrId;
- ManReEntity.UserId = StrUserId;
- ManReEntity.Validflag = "0";
- ManReEntity.DeleteName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- ManReEntity.DeleteUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- ManReEntity.DeleteTime = DateTime.Now;
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ManRelationService", "doUpdate", new object[] { ManReEntity, 0, 0 });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("移除成功", "提示");
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "invPhysic", StrPhysic);
- }
- else
- {
- MessageBox.Show("移除失败"+result.Resultmsg, "提示");
- }
- }
- }
- }
- else
- {
- MessageBox.Show("请选择一条需要删除负责人员信息", "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("删除失败:" + ex.Message,"提示");
- }
- }
- /// <summary>
- /// 编辑物理库区信息
- /// </summary>
- private void EditPhysicWH()// 编辑物理库区信息
- {
- try
- {
- if (ultraGrid1.ActiveRow != null)
- {
- String StrPhysic = ultraGrid1.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- if (StrPhysic != tbxPhysicE.Text.Trim())
- {
- MessageUtil.ShowTips("库区编码不能修改");
- return;
- }
- //提取物理库区编辑区域信息
- string strInvPhysicName = tbxPhysicNameE.Text.ToString().Trim();
- if (strInvPhysicName == "")
- {
- MessageBox.Show("物理库区名称不能为空");
- tbxPhysicNameE.Focus();
- return;
- }
- string strAreaE = tbxAreaE.Text.ToString().Trim();
- if (strAreaE == "")
- {
- MessageBox.Show("物理库区所在区域不能为空");
- tbxAreaE.Focus();
- return;
- }
- if (comIsStrictE.SelectedIndex == -1)
- {
- MessageBox.Show("需指定库区是否为严格储位物理库");
- comIsStrictE.Focus();
- return;
- }
- if (tbx_isJIT.SelectedIndex == -1)
- {
- MessageBox.Show("需指定库区是否为JIT库");
- tbx_isJIT.Focus();
- return;
- }
- if (tbx_isGYB.SelectedIndex == -1)
- {
- MessageBox.Show("需指定库区是否为供应部库");
- tbx_isGYB.Focus();
- return;
- }
- if (tbx_orgId.Text == "" || tbx_orgName.Text == "")
- {
- MessageBox.Show("请指定库区所属部门");
- tbx_orgName.Focus();
- return;
- }
- PhysicSeatEntity Phouse = new PhysicSeatEntity();
- Phouse.InvPhysic = StrPhysic;
- Phouse.InvPhysicName = strInvPhysicName;
- Phouse.InvLocation = strAreaE;
- Phouse.IsStrictBin = comIsStrictE.Value.ToString().Trim();
- Phouse.OrgName = tbx_orgName.Text.ToString().Trim();
- Phouse.OrgId = tbx_orgId.Text.ToString().Trim();
- Phouse.IsJitCk = tbx_isJIT.Value.ToString();
- Phouse.IsGybCk = tbx_isGYB.Value.ToString();
- if (txt_costCenter.SelectedIndex != -1)
- {
- Phouse.CostCenter = txt_costCenter.Value.ToString().Trim();
- }
- Phouse.UpdateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- Phouse.UpdateTime = DateTime.Now;
- Phouse.UpdateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- if (MessageBox.Show("确定修改库区[" + StrPhysic + "]?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
- {
- return;
- }
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ActualSeatService", "doUpdate", new object[] { Phouse, 0, 0 });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("修改成功", "提示");
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "invPhysic", StrPhysic);
- }
- else
- {
- MessageBox.Show("修改失败:" + result.Resultmsg, "提示");
- }
- }
- else
- {
- MessageBox.Show("请选择需要修改的物理库区信息行", "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("修改失败:" + ex.Message,"提示");
- }
- }
- /// <summary>
- /// 新增物理库区信息
- /// </summary>
- private void AddPhysicWH()// 新增物理库区信息
- {
- try
- {
- //提取物理库区编辑区域信息
- string strInvPhysicName = tbxPhysicNameE.Text.ToString().Trim();
- if (strInvPhysicName == "")
- {
- MessageBox.Show("物理库区名称不能为空");
- tbxPhysicNameE.Focus();
- return;
- }
- string strInvPhysic = tbxPhysicE.Text.ToString().Trim();
- if (strInvPhysic == "")
- {
- MessageBox.Show("请输入库区编码,库区编号不能为空");
- tbxPhysicE.Focus();
- return;
- }
- if (!StringUtil.IsOnlyLetterAndDigit(strInvPhysic))
- {
- MessageUtil.ShowTips("物理库区编码只允许数字和字母");
- tbxPhysicE.Focus();
- return;
- }
- if (strInvPhysic.Length>2)
- {
- MessageUtil.ShowTips("编码过长,物理库区编号不能大于2位");
- tbxPhysicE.Focus();
- return;
- }
- if (comIsStrictE.SelectedIndex==-1)
- {
- MessageBox.Show("需指定库区是否为严格储位物理库");
- comIsStrictE.Focus();
- return;
- }
- if (tbx_isJIT.SelectedIndex == -1)
- {
- MessageBox.Show("需指定库区是否为JIT库");
- tbx_isJIT.Focus();
- return;
- }
- if (tbx_isGYB.SelectedIndex == -1)
- {
- MessageBox.Show("需指定库区是否为供应部库");
- tbx_isGYB.Focus();
- return;
- }
- if (tbx_orgId.Text == "" || tbx_orgName.Text == "")
- {
- MessageBox.Show("请指定库区所属部门");
- tbx_orgName.Focus();
- return;
- }
- string strAreaE = tbxAreaE.Text.ToString().Trim();
- PhysicSeatEntity Phouse = new PhysicSeatEntity();
- Phouse.InvPhysic = strInvPhysic;
- Phouse.InvPhysicName = strInvPhysicName;
- Phouse.InvLocation = strAreaE;
- Phouse.IsStrictBin = comIsStrictE.Value.ToString().Trim();
- Phouse.OrgName = tbx_orgName.Text.ToString().Trim();
- Phouse.OrgId = tbx_orgId.Text.ToString().Trim();
- Phouse.IsJitCk = tbx_isJIT.Value.ToString();
- Phouse.IsGybCk = tbx_isGYB.Value.ToString();
- Phouse.Validflag = "1";
- if (txt_costCenter.SelectedIndex != -1)
- {
- Phouse.CostCenter = txt_costCenter.Value.ToString().Trim();
- }
- Phouse.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- Phouse.CreateTime = DateTime.Now;
- Phouse.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ActualSeatService", "AddActualSeat", new object[] { Phouse, 0, 0 });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("新增成功", "提示");
- cleanArea();
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "InvPhysicName", strInvPhysicName);
- }
- else
- {
- MessageBox.Show("新增失败"+result.Resultmsg, "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("新增失败:" + ex.Message,"提示");
- }
- }
- /// <summary>
- /// 新增库位
- /// </summary>
- private void AddPos()// 新增库位
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择物理库区");
- return;
- }
- string strInvPhysic = ultraGrid1.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- string strInvPhysicName = ultraGrid1.ActiveRow.Cells["invPhysicName"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strInvPhysic) || String.IsNullOrEmpty(strInvPhysicName))
- {
- MessageUtil.ShowTips("选择的物理库区编号和名称都不能为空");
- return;
- }
- String strInvPosName = tbxPosNameE.Text.ToString().Trim();
- String strInvPos = tbxPosE.Text.Trim();
- string strremark = tbxRemarkE.Text.ToString().Trim();
- if (strInvPosName == "")
- {
- MessageBox.Show("库位名称不能为空", "提示");
- tbxPosNameE.Focus();
- return;
- }
- ActualSeatPosEntity PosEntity = new ActualSeatPosEntity();
- PosEntity.InvPos = strInvPos;
- PosEntity.InvPhysicName = strInvPhysicName;
- PosEntity.InvPhysic = strInvPhysic;
- PosEntity.InvPosName = strInvPosName;
- PosEntity.Remark = strremark;
- PosEntity.Validflag = "1";
- PosEntity.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- PosEntity.CreateTime = DateTime.Now;
- PosEntity.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ActualSeatPosService", "addPos", new object[] { PosEntity });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("新增成功", "提示");
- cleanArea();
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "invPhysic", strInvPhysic);
- ConfigureClassCommon.doActiveSelRow(ultraGrid2, "invPosName", strInvPosName);
- }
- else {
- MessageBox.Show("新增失败:" + result.Resultmsg, "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("新增绑定库位失败:" + ex.Message, "提示");
- }
- }
- /// <summary>
- /// 新增人员
- /// </summary>
- private void AddMan()// 新增人员
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择物理库区");
- return;
- }
- string strInvPhysic = ultraGrid1.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- string strInvPhysicName = ultraGrid1.ActiveRow.Cells["invPhysicName"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strInvPhysic) || String.IsNullOrEmpty(strInvPhysicName))
- {
- MessageUtil.ShowTips("选择的物理库区编号和名称都不能为空");
- return;
- }
- String strUser = tbxUserE.Text.ToString().Trim();
- string strUserName = tbxUserNameE.Text.ToString().Trim();
- if (strUser == "" || strUserName == "")
- {
- MessageBox.Show("值班人员信息维护错误,编号和人员名都不能为空", "提示");
- tbxPhysicNameE.Focus();
- return;
- }
- ManRelationEntity manReEntity = new ManRelationEntity();
- manReEntity.UserId = strUser;
- manReEntity.UserName = strUserName;
- manReEntity.InvPhysic = strInvPhysic;
- manReEntity.InvPhysicName = strInvPhysicName;
- manReEntity.Validflag = "1";
- manReEntity.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- manReEntity.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- manReEntity.CreateTime = DateTime.Now;
- CoreResult result = this.execute<CoreResult>("com.hnshituo.pur.configure.service.ManRelationService", "addman", new object[] { manReEntity });
- if (result.Resultcode == 0)
- {
- MessageBox.Show("新增成功", "提示");
- cleanArea();
- GetQureyPhysicWH();
- ConfigureClassCommon.doActiveSelRow(ultraGrid1, "invPhysic", strInvPhysic);
- ConfigureClassCommon.doActiveSelRow(ultraGrid3, "userId", strUser);
- }
- else
- {
- MessageBox.Show("新增绑定值班人员失败:" + result.Resultmsg, "提示");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("新增绑定值班人员失败:" + ex.Message, "提示");
- }
- }
- #endregion
- #region 界面事件
- private void ultraGrid1_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- dataSet2.Clear();
- dataSet3.Clear();
- String strInvPhysic = ultraGrid1.ActiveRow.Cells["invPhysic"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strInvPhysic))
- {
- return;
- }
- //查询库位信息
- ActualSeatPosEntity PosEntity = new ActualSeatPosEntity();
- PosEntity.Validflag = "1";
- PosEntity.InvPhysic = strInvPhysic;
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.configure.service.ActualSeatPosService", "find", new object[] { PosEntity, 0, 0 });
- if (dt != null)
- {
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
- GridHelper.RefreshAndAutoSize(ultraGrid2);
- }
- //查询值班人员信息
- ManRelationEntity ManReEntity = new ManRelationEntity();
- ManReEntity.Validflag = "1";
- ManReEntity.InvPhysic = strInvPhysic;
- DataTable dt1 = this.execute<DataTable>("com.hnshituo.pur.configure.service.ManRelationService", "find", new object[] { ManReEntity, 0, 0 });
- if (dt1 != null)
- {
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable3, true);
- GridHelper.RefreshAndAutoSize(ultraGrid3);
- }
- //填充物理库编辑区
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[0];
- cleanArea();
- if (String.IsNullOrEmpty(strInvPhysic))
- {
- return;
- }
- PhysicSeatEntity seat = this.execute<PhysicSeatEntity>("com.hnshituo.pur.configure.service.ActualSeatService", "findById", new object[] { strInvPhysic});
- if (seat != null)
- {
- tbxPhysicE.Text = seat.InvPhysic;
- tbxPhysicNameE.Text = seat.InvPhysicName;
- tbxAreaE.Text = seat.InvLocation;
- comIsStrictE.Value = seat.IsStrictBin;
- tbx_isJIT.Value = seat.IsJitCk;
- tbx_isGYB.Value = seat.IsGybCk;
- tbx_orgId.Text = seat.OrgId;
- tbx_orgName.Text = seat.OrgName;
- txt_costCenter.Value = seat.CostCenter;
- }
- }
- private void ultraGrid1_Click(object sender, EventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[0];
- }
- private void ultraGrid2_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[1];
- //填充库位编辑区
- cleanArea();
- String strID = e.Cell.Row.Cells["ID"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strID))
- {
- return;
- }
- ActualSeatPosEntity PosEntity = this.execute<ActualSeatPosEntity>("com.hnshituo.pur.configure.service.ActualSeatPosService", "findById", new object[] { strID});
- if (PosEntity != null)
- {
- tbxPosE.Text = PosEntity.Id;
- tbxPosNameE.Text = PosEntity.InvPosName;
- tbxRemarkE.Text = PosEntity.Remark;
- }
- }
- private void ultraGrid2_Click(object sender, EventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[1];
- }
- private void ultraGrid3_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[2];
- cleanArea();
- String strID = e.Cell.Row.Cells["ID"].Value.ToString().Trim();
- if (String.IsNullOrEmpty(strID))
- {
- return;
- }
- ManRelationEntity ManReEntity = this.execute<ManRelationEntity>("com.hnshituo.pur.configure.service.ManRelationService", "findById", new object[] { strID});
- if (ManReEntity != null)
- {
- tbxUserE.Text = ManReEntity.UserId;
- tbxUserNameE.Text = ManReEntity.UserName;
- }
- }
- private void ultraGrid3_Click(object sender, EventArgs e)
- {
- ultraTabControl1.SelectedTab = ultraTabControl1.Tabs[2];
- }
- #endregion
- /// <summary>
- /// 清空编辑区
- /// </summary>
- private void cleanArea()// 清空编辑区
- {
- //清空物理库区编辑区信息
- tbxPhysicE.Text = "";
- tbxPhysicNameE.Text = "";
- tbxAreaE.Text = "";
- comIsStrictE.SelectedIndex = -1;
- tbx_isJIT.SelectedIndex = -1;
- tbx_isGYB.SelectedIndex = -1;
- tbx_orgId.Text = "";
- tbx_orgName.Text = "";
- //清楚库位区编辑区信息
- tbxPosE.Text = "";
- tbxPosNameE.Text = "";
- tbxRemarkE.Text = "";
- //清空值班人员编辑区信息
- tbxUserE.Text = "";
- tbxUserNameE.Text = "";
- }
- /// <summary>
- /// 增加绑定库位
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void AddPosbutton_Click(object sender, EventArgs e)
- {
- AddPos();
- }
- /// <summary>
- /// 增加值班人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void AddManbutton_Click(object sender, EventArgs e)
- {
- AddMan();
- }
- /// <summary>
- /// 选择值班人员
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ManSelectButton_Click(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- SetectManByDept manfrm = new SetectManByDept(this.ob);
- manfrm.ShowDialog();
- string struserid = manfrm.StrUserID;
- string strusername = manfrm.StrUserName;
- tbxUserE.Text = struserid;
- tbxUserNameE.Text = strusername;
- }
- /// <summary>
- /// 选择部门
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tbx_orgName_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- frmdepartment frm = new frmdepartment(this.ob);
- frm.ShowDialog();
- String strdeptId = frm.BuyerUnitCode;
- String strDeptName = frm.Fulltext;
- if (strdeptId != null && strdeptId != "")
- {
- tbx_orgId.Text = strdeptId;
- tbx_orgName.Text = strDeptName;
- }
- }
- private void AddSitebutton_Click(object sender, EventArgs e)
- {
- AddPhysicWH();
- }
- }
- }
|