private void btReEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { frmyxfxEdit fm = new frmyxfxEdit(); PJ_03yxfx yxfx = new PJ_03yxfx(); DataRow dr = gridView1.GetFocusedDataRow(); if (dr == null) return; foreach (DataColumn dc in gridtable.Columns) { if (dc.ColumnName != "Image") yxfx.GetType().GetProperty(dc.ColumnName).SetValue(yxfx, dr[dc.ColumnName], null); } fm.RowData = yxfx; if (isJu()) { fm.RecordStatus = 4; } else { fm.RecordStatus = 3; } if (fm.ShowDialog() == DialogResult.OK) { RefreshData("where orgcode='" + yxfx.OrgCode + "'and type='" + yxfx.type + "' order by id desc"); } }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { frmyxfxEdit fm = new frmyxfxEdit(); PJ_03yxfx yxfx = new PJ_03yxfx(); DataRow dr = gridView1.GetFocusedDataRow(); if (dr == null) return; foreach (DataColumn dc in gridtable.Columns) { if (dc.ColumnName != "Image") yxfx.GetType().GetProperty(dc.ColumnName).SetValue(yxfx, dr[dc.ColumnName], null); } fm.RowData = yxfx; fm.RecordStatus = -1; fm.ShowDialog(); //if (MainHelper.UserOrg == null) return; //if (gridView1.FocusedRowHandle >= 0) //{ // DataRow dr = gridView1.GetFocusedDataRow(); // PJ_03yxfx yxfx = new PJ_03yxfx(); // foreach (DataColumn dc in gridtable.Columns) // { // if (dc.ColumnName != "Image") yxfx.GetType().GetProperty(dc.ColumnName).SetValue(yxfx, dr[dc.ColumnName], null); // } // //if (!RecordWorkTask.HaveRunRecordRole(yxfx.ID, MainHelper.User.UserID)) return; // DataTable dt = RecordWorkTask.GetRecordWorkFlowData(yxfx.ID, MainHelper.User.UserID); // frmyxfxEdit fm = new frmyxfxEdit(); // IList<mUser> lm = ClientHelper.PlatformSqlMap.GetList<mUser>(" where usercode in (select UserID from ruserrole where roleID in (select RoleID from mRole where RoleName in ('生产局长','生技部长') ))"); // string usercode = MainHelper.User.UserCode; // for (int i = 0; i < lm.Count; i++) // { // if (lm[i].UserCode == usercode) // { // if (btReEdit.Caption == "领导检查") // { // fm.RecordStatus = 1; // break; // } // else if (btReEdit.Caption == "检查人检查") // { // fm.RecordStatus = 2; // break; // } // } // else if (i == lm.Count - 1 && lm[i].UserCode != usercode) // { // MsgBox.ShowWarningMessageBox("抱歉,您没有检查权限!"); // return; // } // } // fm.RecordWorkFlowData = dt; // fm.RowData = yxfx; // fm.ShowDialog(); // RefreshData("where orgcode='" + btGdsList.EditValue + "'and type='" + recordIkind + "' order by id desc"); //} //else //{ // return; //} }
private void btReAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { frmyxfxEdit fm = new frmyxfxEdit(); PJ_03yxfx yxfx = new PJ_03yxfx(); if (MainHelper.UserOrg == null) return; string orgcode = ""; if (isJu() && barJU.Visibility== DevExpress.XtraBars.BarItemVisibility.Always) { orgcode = barJU.EditValue.ToString(); } else { orgcode = btGdsList.EditValue.ToString(); } IList<mOrg> list = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>("where orgcode='" + orgcode + "'"); mOrg org = null; if (list.Count > 0) org = list[0]; yxfx.OrgCode = orgcode; yxfx.OrgName = org.OrgName; yxfx.type = recordIkind; yxfx.rq = DateTime.Now; fm.RowData = yxfx; fm.RecordStatus = 0; if (fm.ShowDialog() == DialogResult.OK) { RefreshData("where orgcode='" + orgcode + "'and type='" + recordIkind + "' order by id desc"); } }