protected override bool WfQuery() { DataRow drNew; try { //DtMaster = BoMaster.OfGetDataTable(StrSqlBody + " AND 1<>1 "); DtMaster = BoMaster.OfGetDataTable(StrSqlBody); ////修改column 型別為string 並將實際的型別丟到 column.prefix //foreach (DataColumn ldc_temp in DtMaster.Columns) //{ // if (ldc_temp.Prefix != "") // continue; // ldc_temp.Prefix = ldc_temp.DataType.Name; // ldc_temp.DataType = typeof(string); //} BindingMaster.DataSource = DtMaster; uGrid_Master.DataSource = BindingMaster; drNew = DtMaster.NewRow(); DtMaster.Rows.Add(drNew); uGrid_Master.ActiveCell = uGrid_Master.Rows[0].Cells[1]; return(true); } catch (Exception ex) { throw ex; } }
protected override bool WfQueryOk() { //List<string> actAllArray = null; List <string> actChooseList = null; try { DtMaster.Rows.Clear(); if (!GlobalFn.varIsNull(_actAllList)) { //actAllArray = _actAllList.Split(new char[] { ',' }) // .ToList<string>(); if (!GlobalFn.varIsNull(_actChoose)) { actChooseList = _actChoose.Split(new char[] { ',' }) .ToList <string>(); } foreach (adq_tb adqModel in _actAllList) { var drNew = DtMaster.NewRow(); drNew["is_pick"] = "N"; if (actChooseList != null) { var chkCnts = actChooseList.Where(p => p.ToLower() == adqModel.adq02.ToLower()).Count(); if (chkCnts > 0) { drNew["is_pick"] = "Y"; } } drNew["action"] = adqModel.adq02; drNew["action_c"] = adqModel.adq03; DtMaster.Rows.Add(drNew); } //DtMaster = BoMaster.OfGetDataTable(StrSqlBody + extendSqlWhere, SqlParmTotalList.ToArray()); } BindingMaster.DataSource = DtMaster; //改取sort後的第一筆 if (DtMaster != null && DtMaster.Rows.Count > 0) { uGrid_Master.Rows.GetRowWithListIndex(0).Selected = true; } return(true); } catch (Exception ex) { throw ex; } }
protected override bool WfReturnOk() { DataRow[] returnRowCollection; try { MsgInfoReturned.DataRowList.Clear(); MsgInfoReturned.Result = System.Windows.Forms.DialogResult.OK; returnRowCollection = DtMaster.Select(" is_pick ='Y' "); if (returnRowCollection != null) { MsgInfoReturned.DataRowList.AddRange(returnRowCollection); } MsgInfoReturned.StrMultiRtn = WfGetStrMultiRtrn(returnRowCollection, ','); this.Close(); return(true); } catch (Exception ex) { throw ex; } }