//============================================================ private void MatchOperation(int modid) { #region 匹配生产订单行对应指令单子件工艺 var wodal = new WorkOrderDAL(); var dtRouter = wodal.GetRouter(modid); var dtDetail = wodal.GetDetail(modid); foreach (DataRow d in dtDetail.Rows) { if (string.IsNullOrEmpty(d["operationId"].ToString())) { continue; } var gyArray = dtRouter.Select("operationId = " + d["operationId"] + " and guid = '" + d["guid"] + "'"); if (gyArray != null && gyArray.Length == 1) { d["routerId"] = gyArray[0]["autoid"]; var autoid = Convert.ToInt32(d["AutoId"]); var routerid = Convert.ToInt32(d["routerId"]); wodal.UpdateWODRouterId(autoid, routerid); } else { continue; } } #endregion }
private void FormLoad(object sender, EventArgs e) { #region 加载主窗体事件 new Thread(() => { this.BeginInvoke(new Action(() => { dvDetail = dal.GetDetail(woGuid).DefaultView; this.gridControl1.DataSource = dvDetail; })); }).Start(); repositoryItemLookUpEdit1.DataSource = dal.GetRouter(woGuid); repositoryItemLookUpEdit1.KeyMember = "autoid"; repositoryItemLookUpEdit1.ValueMember = "autoid"; repositoryItemLookUpEdit1.DisplayMember = "OpName"; repositoryItemLookUpEdit1.Columns.AddRange( new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] { new DevExpress.XtraEditors.Controls.LookUpColumnInfo("OpSeq", "序号"), new DevExpress.XtraEditors.Controls.LookUpColumnInfo("OpName", "工序") }); #endregion }
private void btnEditDetail_Click(object sender, EventArgs e) { #region 修改子件 if (dal.ExistRef(model.Guid)) { throw new Exception("已经生成流转卡,不能修改!"); } FmWODetails frm = new FmWODetails(model.Guid); if (frm.ShowDialog() == DialogResult.OK) { this.model = dal.Get(model.Guid); gridControl2.DataSource = dal.GetDetail(model.Guid); } #endregion }