| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using System.Windows.Media.Animation; |
| | | |
| | | namespace Gs.DevApp.DevFrm |
| | | { |
| | | public partial class Frm_MesItemQtrk : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | string _webServiceName = "User/"; |
| | | string _webServiceName = "MesItemQtrkManager/"; |
| | | List<FilterEntity> _filterList = new List<FilterEntity>(); |
| | | public Frm_MesItemQtrk() |
| | | { |
| | |
| | | Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); |
| | | e.Graphics.DrawString(str, f, Brushes.Gray, r); |
| | | }; |
| | | |
| | | //设置仓库选择 |
| | | this.txt_qt011.KeyFile = "depotId"; |
| | | this.txt_qt011.EditChanged += (s, e) => |
| | | { |
| | | |
| | | }; |
| | | //设置供应商选择 |
| | | this.txt_qt018.KeyFile = "id"; |
| | | this.txt_qt018.EditChanged += (s, e) => |
| | | { |
| | | |
| | | }; |
| | | var _obj = new |
| | | { |
| | | currentPage = 1, |
| | | everyPageSize = 999999, |
| | | sortName = "", |
| | | keyWhere = "", |
| | | }; |
| | | var json = JsonConvert.SerializeObject(_obj); |
| | | try |
| | | { |
| | | var strReturn = UtilityHelper.HttpPost("", |
| | | "MesItemsManager/GetListSelect", json); |
| | | var rtn = UtilityHelper.ReturnToTablePage(strReturn); |
| | | var dt = rtn.rtnData.list; |
| | | this.repositoryItemGridLookUpEdit1.DataSource = dt; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | private async void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | |
| | | /// <param name="e"></param> |
| | | private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) |
| | | { |
| | | |
| | | _filterList = e.FilterList; |
| | | getPageList(1); |
| | | } |
| | |
| | | private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.isSetBtn = false; |
| | | //if (string.IsNullOrEmpty(txt_account.Text.Trim())) |
| | | string inGys = txt_qt018.GetId(); |
| | | string inCjId = txt_qt011.GetId(); |
| | | if (string.IsNullOrEmpty(inGys)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("登录账号不能为空!"); |
| | | // txt_account.Focus(); |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择供应商!"); |
| | | txt_qt018.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(inCjId)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择仓库!"); |
| | | txt_qt011.Focus(); |
| | | return; |
| | | } |
| | | var _obj = new |
| | | { |
| | | guid =UtilityHelper.ToGuid( lbGuid.Text.Trim()), //主建 |
| | | inRklb = txt_qt003.Text.Trim(),//备注 |
| | | inYwlx = txt_qt004.Text.Trim(),//业务类型 |
| | | inRkfs = txt_qt019.Text.Trim(),//入库方式 |
| | | inRklx = txt_qt020.Text.Trim(),//入库类型 |
| | | inGys = inGys,//供应商 |
| | | inCjId = inCjId,//入库仓库 |
| | | inDepart = txt_qt009.Text.Trim(),//申请部门 |
| | | inXsdh = txt_qt021.Text.Trim(),//销售单号 |
| | | inRkyy = txt_qt010.Text.Trim(),//入库原因 |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | if (gvMx1.DataRowCount <= 0) |
| | | { |
| | | MsgHelper.ShowError("明细不能为空,请选择你的收料明细!"); |
| | | return; |
| | | } |
| | | for (var i = 0; i < gvMx1.DataRowCount; i++) |
| | | { |
| | | var row = gvMx1.GetDataRow(i); |
| | | if (row != null) |
| | | { |
| | | Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString()); |
| | | //string _msl = row["quantity"].ToString(); |
| | | //if (string.IsNullOrEmpty(_msl)) |
| | | //{ |
| | | // MsgHelper.ShowError("数量不能为空!"); |
| | | // return; |
| | | //} |
| | | _obj.list.Add(new |
| | | { |
| | | Guid = _guid, |
| | | itemId = (row["itemId"].ToString()), |
| | | sqsl = (row["qd007"].ToString()), |
| | | }); |
| | | } |
| | | } |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | |
| | | { |
| | | UcLoading _loading = new UcLoading(); |
| | | var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | | { |
| | |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void repositoryItemGridLookUpEdit1_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | GridLookUpEdit LookupEdit = sender as GridLookUpEdit; |
| | | DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); |
| | | gvMx1.SetFocusedRowCellValue("qd002", SelectedDataRow["itemNo"]); |
| | | gvMx1.SetFocusedRowCellValue("qd003", SelectedDataRow["itemName"]); |
| | | gvMx1.SetFocusedRowCellValue("qd004", SelectedDataRow["itemModel"]); |
| | | } |
| | | } |
| | | } |