public string Insert(FlowProperty dataItem) { sql = @"INSERT INTO flow ( ID , FLOW_NAME , FLOW_TYPE_ID , INUSE , PRODUCT_SUB_CODE ) ( SELECT 1 + coalesce((SELECT max(Id) FROM flow), 0) , 'dataItem.FLOW_NAME' , 'dataItem.FLOW_TYPE_ID' , 1 , 'dataItem.PRODUCT_SUB_CODE' )"; sql = sql.Replace("dataItem.ID", dataItem.ID); sql = sql.Replace("dataItem.FLOW_NAME", dataItem.FLOW_NAME); sql = sql.Replace("dataItem.FLOW_TYPE_ID", dataItem.FLOW_TYPE.ID); sql = sql.Replace("dataItem.INUSE", dataItem.INUSE); sql = sql.Replace("dataItem.PRODUCT_SUB_CODE", dataItem.PRODUCT_SUB_CODE); return(sql); }
private void cmbFlow_SelectedIndexChanged(object sender, EventArgs e) { this.treeViewSetProcess.Nodes.Clear(); int no = 1; int noSub = 1; List <ProcessProperty> _listProcess = new List <ProcessProperty>(); List <ProcessSubProperty> _listProcessSub = new List <ProcessSubProperty>(); _flow = new FlowProperty { FLOW_NAME = this.cmbFlow.Text.ToString() }; _listProcess = _flowControllers.SearchProcessByFlowName(_flow); _listProcessSub = _flowControllers.SearchProcessSubByFlowName(_flow); foreach (ProcessProperty _process in _listProcess) { noSub = 1; treeViewSetProcess.Nodes.Add(no + "_" + _process.PROCESS_NAME); foreach (ProcessSubProperty _processSub in _listProcessSub.FindAll(x => x.PROCESS_ID == _process.ID)) { treeViewSetProcess.Nodes[treeViewSetProcess.Nodes.Count - 1].Nodes.Add(noSub + "_" + _processSub.SUB_PROCESS_NAME); noSub += 1; } no += 1; } }
private void createTree() { this.treeViewSetProcess.Nodes.Clear(); // if cmb purchase & cmb flow != "" // Load process in list process (1.3) int no = 1; int noSub = 1; List <ProcessProperty> _listProcess = new List <ProcessProperty>(); List <ProcessSubProperty> _listProcessSub = new List <ProcessSubProperty>(); _flow = new FlowProperty { FLOW_NAME = this.cmbFlow.Text.ToString() }; _listProcess = _flowControllers.SearchProcessByFlowName(_flow); _listProcessSub = _flowControllers.SearchProcessSubByFlowName(_flow); foreach (ProcessProperty _process in _listProcess) { noSub = 1; treeViewSetProcess.Nodes.Add(no + "_" + _process.PROCESS_NAME); foreach (ProcessSubProperty _processSub in _listProcessSub.FindAll(x => x.PROCESS_ID == _process.ID)) { treeViewSetProcess.Nodes[treeViewSetProcess.Nodes.Count - 1].Nodes.Add(noSub + "_" + _processSub.SUB_PROCESS_NAME); noSub += 1; } no += 1; } //by Boat 03/11/2019 }
public string UpdateStatus(FlowProperty dataItem) { sql = @"UPDATE `flow` SET INUSE = '" + dataItem.INUSE + @"' WHERE REPLACE(FLOW_NAME, ' ', '') = REPLACE('" + dataItem.FLOW_NAME + @"', ' ', '');"; return(sql); }
private void SetFolw() { FlowProperty _flowDetail = _flowControllers.SearchFlowByFlowName(new FlowProperty { FLOW_NAME = _updateOrder.FLOW.FLOW_NAME }); _listflow = new List <FlowProperty>(); _listflow = _flowControllers.SearchFlowByProduct(new FlowProperty { PRODUCT_SUB_CODE = _flowDetail.PRODUCT_SUB_CODE }); this.cmbFlow.Items.Clear(); this.cmbFlow.Items.Add("-Select Flow-"); foreach (FlowProperty _flow in _listflow) { this.cmbFlow.Items.Add(_flow.FLOW_NAME); } if (cmbFlow.FindString(this.txtFlow.Text) != -1) { this.cmbFlow.SelectedItem = this.txtFlow.Text; } else { this.cmbFlow.SelectedIndex = 0; } }
public List <FlowProperty> SearchFlowByProduct(FlowProperty dataItem) { List <FlowProperty> _result = new List <FlowProperty>(); try { _resultData = _models.SearchFlowByProduct(dataItem); if (_resultData.StatusOnDb == true) { if (_resultData.ResultOnDb.Rows.Count > 0) { for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++) { FlowProperty _Process = new FlowProperty { FLOW_NAME = _resultData.ResultOnDb.Rows[i]["FLOW_NAME"].ToString(), ID = _resultData.ResultOnDb.Rows[i]["ID"].ToString() }; _result.Add(_Process); } } } else { MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(_result); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(_result); } }
public FlowProperty SearchFlowByFlowName(FlowProperty dataItem) { FlowProperty _flow = new FlowProperty(); try { _resultData = _models.SearchFlowByFlowName(dataItem); if (_resultData.StatusOnDb == true) { if (_resultData.ResultOnDb.Rows.Count > 0) { _flow = new FlowProperty { ID = _resultData.ResultOnDb.Rows[0]["ID"].ToString(), FLOW_NAME = _resultData.ResultOnDb.Rows[0]["FLOW_NAME"].ToString(), PRODUCT_SUB_CODE = _resultData.ResultOnDb.Rows[0]["PRODUCT_SUB_CODE"].ToString(), INUSE = _resultData.ResultOnDb.Rows[0]["INUSE"].ToString(), }; } } else { MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(_flow); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(_flow); } }
public List <ProcessSubProperty> SearchProcessSubByFlowName(FlowProperty dataItem) { List <ProcessSubProperty> _result = new List <ProcessSubProperty>(); try { _resultData = _models.SearchProcessSubByFlowName(dataItem); if (_resultData.StatusOnDb == true) { if (_resultData.ResultOnDb.Rows.Count > 0) { for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++) { ProcessSubProperty _Process = new ProcessSubProperty { SUB_PROCESS_NAME = _resultData.ResultOnDb.Rows[i]["SUB_PROCESS_NAME"].ToString(), PROCESS_ID = _resultData.ResultOnDb.Rows[i]["PROCESS_ID"].ToString(), }; _result.Add(_Process); } } } else { MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(_result); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(_result); } }
public List <FlowProperty> LoadFlow() { List <FlowProperty> _result = new List <FlowProperty>(); try { _resultData = _models.LoadFlow(); if (_resultData.StatusOnDb == true) { if (_resultData.ResultOnDb.Rows.Count > 0) { for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++) { FlowProperty _flow = new FlowProperty { ID = _resultData.ResultOnDb.Rows[i]["FLOW_ID"].ToString() , FLOW_NAME = _resultData.ResultOnDb.Rows[i]["FLOW_NAME"].ToString() }; _result.Add(_flow); } } } else { MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(_result); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(_result); } }
public FlowProperty CallFlowRMA() { FlowProperty _result = new FlowProperty(); try { _resultData = _models.CallFlowRMA(); if (_resultData.StatusOnDb == true) { if (_resultData.ResultOnDb.Rows.Count > 0) { for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++) { _result.FLOW_NAME = _resultData.ResultOnDb.Rows[i]["FLOW_NAME"].ToString(); } } } else { MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(_result); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(_result); } }
private void dgvFlow_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { this.cmbStatus.Items.Clear(); this.cmbStatus.Items.Add("Use"); this.cmbStatus.Items.Add("Cancel"); if (this.dgvFlow.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) { this.dgvFlow.CurrentRow.Selected = true; //Get FlowProperty //This Column in "adgvCondition" is visible. _flow = new FlowProperty { FLOW_NAME = this.dgvFlow.Rows[e.RowIndex].Cells["FLOW_NAME"].FormattedValue.ToString(), STATUS = this.dgvFlow.Rows[e.RowIndex].Cells["STATUS"].FormattedValue.ToString() }; this.lblFlowName.Text = _flow.FLOW_NAME; this.cmbStatus.Text = _flow.STATUS; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
private void Load_Flow() { _flow = new FlowProperty(); _flow = _controllerFlow.CallFlowRMA(); this.cmbSelect_FlowName.Text = _flow.FLOW_NAME.ToString(); this.tableRMA = GetTable(); }
public MyReportingTask() { // Register properties so DriveWorks can see them and build rules for them. myReportClass = this.Properties.RegisterStringProperty("Report Class", "The Report Class is what type of report you are creating and what action you are performing."); myReportTarget = this.Properties.RegisterStringProperty("Report Target", "The Report Target identifies what the report entry is referencing."); myReportDescription = this.Properties.RegisterStringProperty("Report Description", "Enter a description about the object you are reporting on."); myReportEntryDetail = this.Properties.RegisterStringProperty("Report Entry Detail", "Enter a entry detail about the object you are reporting on."); }
private void btnUpdate_Click(object sender, EventArgs e) { if (cmbFlow.Text == "-Select Flow-") { MessageBox.Show("Please Select Flow", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } int index = _listflow.FindIndex(x => x.FLOW_NAME == this.txtFlow.Text); _updateOrder.FLOW.FLOW_NAME = _listflow[index].FLOW_NAME; _updateOrder.FLOW.ID = _listflow[index].ID; _updateOrder.EMP = _frmMain._empLogin; if (_updateOrder.PURCHASE_NO != "" && _updateOrder.PURCHASE_NO != null) { if (this.txtPathProcessCard.Text != "") { _updateOrder.PATH_PROCESS_CARD = this.txtPathProcessCard.Text.Replace(@"\", @"\\"); PurchaseProperty _updatePurchase = _updateOrderForCopy; FlowProperty _flowDetail = _flowControllers.SearchFlowByFlowName(new FlowProperty { FLOW_NAME = cmbFlow.Text }); _updatePurchase.FLOW.FLOW_NAME = cmbFlow.Text; _updatePurchase.FLOW.ID = _flowDetail.ID; if (_controllers.UpdateProcessCardPurchase(_updateOrder, _updatePurchase)) { this.LoadPurchaseAll(); } //if (_updateOrder.FLOW.FLOW_NAME != cmbFlow.Text) //{ // FlowProperty _flowDetail = _flowControllers.SearchFlowByFlowName(new FlowProperty { FLOW_NAME = cmbFlow.Text }); // _updateOrder.FLOW.FLOW_NAME = cmbFlow.Text; // _updateOrder.FLOW.ID = _flowDetail.ID; // if (_controllers.UpdateProcessCardPurchase(_updateOrder)) // { // this.LoadPurchaseAll(); // } //} } else { MessageBox.Show("Please Choose file Processcaed ", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { MessageBox.Show("Please Select Purchase", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
public string SearchProcessSubByFlowName(FlowProperty dataItem) { sql = @" SELECT tb_1.FLOW_NAME ,tb_2.PROCESS_SUB_ID ,tb_4.ID as PROCESS_ID ,tb_2.`NO` ,tb_3.SUB_PROCESS_NAME FROM `flow` AS tb_1 INNER JOIN `process_sub_flow` AS tb_2 ON(tb_2.FLOW_ID = tb_1.ID) INNER JOIN `process_sub` AS tb_3 ON( tb_3.PROCESS_SUB_ID = tb_2.PROCESS_SUB_ID) INNER JOIN `process` AS tb_4 ON( tb_3.PROCESS_ID = tb_4.ID) WHERE REPLACE(tb_1.`FLOW_NAME`, ' ', '') = REPLACE('" + dataItem.FLOW_NAME + @"', ' ', '') AND tb_1.`INUSE` = '1' ORDER BY tb_2.`NO`"; return(sql); }
public bool UpdateStatus(FlowProperty dataItem) { bool _result = false; try { _resultData = _models.UpdateStatus(dataItem); if (_resultData.StatusOnDb == true) { MessageBox.Show(_resultData.MessageOnDb, "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); _result = true; } else { MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(_result); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(_result); } }
public OutputOnDbProperty SearchFlowByProduct(FlowProperty dataItem) { _resultData = _services.SearchFlowByProduct(dataItem); return(_resultData); }
public OutputOnDbProperty UpdateStatus(FlowProperty dataItem) { sql = _sqlFactory.UpdateStatus(dataItem); resultData = base.UpdateBySql(sql); return(resultData); }
public OutputOnDbProperty SearchFlowByProduct(FlowProperty dataItem) { sql = _sqlFactory.SearchFlowByProduct(dataItem); resultData = base.SearchBySql(sql); return(resultData); }
public OutputOnDbProperty SearchProcessSubByFlowName(FlowProperty dataItem) { sql = _sqlFactory.SearchProcessSubByFlowName(dataItem); resultData = base.SearchBySql(sql); return(resultData); }
public MySpecificationMacroCondition() { // Register properties so DriveWorks can see them and build rules for them. MyProperty = this.Properties.RegisterBooleanProperty("Condition Result", "Specifies the result of the condition."); }
public MyGenerationTaskSpecificationCondition() { mValue = this.Properties.RegisterDoubleProperty("Value", "The value to check for must be an even number for the condition to pass."); }
public string SearchFlowByFlowName(FlowProperty dataItem) { sql = @"SELECT * from flow where FLOW_NAME = '" + dataItem.FLOW_NAME + @"' and INUSE = 1"; return(sql); }
public string SearchFlowByProduct(FlowProperty dataItem) { sql = @"SELECT * from flow where PRODUCT_SUB_CODE = '" + dataItem.PRODUCT_SUB_CODE + @"' and INUSE = 1"; return(sql); }
public OutputOnDbProperty UpdateStatus(FlowProperty dataItem) { _resultData = _services.UpdateStatus(dataItem); return(_resultData); }
public OutputOnDbProperty SearchProcessSubByFlowName(FlowProperty dataItem) { _resultData = _services.SearchProcessSubByFlowName(dataItem); return(_resultData); }
private void CreateFlow() { if (treeViewSetProcess.Nodes.Count == 0) { MessageBox.Show("Please Select Process For Create Flow", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } int NOProcess = 0; int NOProcessSub = 0; List <ProcessFlowProperty> _listFlowProcess = new List <ProcessFlowProperty>(); List <ProcessSubFlowProperty> _listFlowProcessSub = new List <ProcessSubFlowProperty>(); foreach (TreeNode processMainNode in treeViewSetProcess.Nodes) { NOProcessSub = 0; FlowProperty _flowProperty = new FlowProperty { FLOW_NAME = txtFlowName.Text, FLOW_TYPE = new FlowTypeProperty { ID = "1" }, PRODUCT_SUB_CODE = (cmbProduct.SelectedItem as ComboboxItem).Value.ToString() }; ProcessFlowProperty _flowProcessProperty = new ProcessFlowProperty { FLOW = _flowProperty, PROCESS = new ProcessProperty() { ID = processMainNode.Name.ToString() }, NO = (++NOProcess).ToString(), CREATE_USER = _frmMain._empLogin.code }; _listFlowProcess.Add(_flowProcessProperty); foreach (TreeNode processSubNode in processMainNode.Nodes) { ProcessSubFlowProperty _flowProcessSubProperty = new ProcessSubFlowProperty { FLOW = _flowProperty, PROCESS_SUB = new ProcessSubProperty { PROCESS_SUB_ID = processSubNode.Name }, NO = (++NOProcessSub).ToString(), CREATE_USER = _frmMain._empLogin.code }; _listFlowProcessSub.Add(_flowProcessSubProperty); } } ////Get Procress for get id //List<ProcessProperty> _getProcess = new List<ProcessProperty>(); //for (int i = 0; i < treeViewSetProcess.Items.Count; i++) //{ // int NOProcess = i + 1; // ProcessProperty _process = new ProcessProperty() // { // ID = listSelectProcess[i].ID.ToString() // , // PROCESS_NAME = listSelectProcess[i].PROCESS_NAME.ToString() // , // NO = NOProcess.ToString() // }; // _getProcess.Add(_process); //} //FlowProcessProperty _flowInsert = new FlowProcessProperty(); //_flowInsert.FLOW = new FlowProperty //{ // FLOW_NAME = txtFlowName.Text //}; //_flowInsert.PROCESS = new List<ProcessProperty>(); //_flowInsert.PROCESS = _getProcess; //////Get Process ID. ////foreach (ProcessProperty _process in _getProcess) ////{ //// foreach (ProcessProperty _processAll in _listProcessAll) //// { //// if (_process.PROCESS_NAME == _processAll.PROCESS_NAME) //// { //// ProcessProperty _orderprocess = new ProcessProperty() //// { //// ID = _processAll.ID //// ,NO = _process.NO //// ,PROCESS_NAME = _processAll.PROCESS_NAME //// }; //// _flowInsert.PROCESS.Add(_orderprocess); //// } //// } ////} //// Check Flow process //_listFlowProcess = new List<FlowProcessProperty>(); //string countNoProcess = Convert.ToString(_getProcess.Count); //_listFlowProcess = _controllers.CheckDuplicateFlowProcess(countNoProcess); //bool status = false; //foreach (FlowProcessProperty flow in _listFlowProcess) //{ // int j = 0; // for (int i = 0; i < Convert.ToInt16(countNoProcess); i++) // { // status = false; // if (flow.PROCESS[i].PROCESS_NAME.ToString() == listSelectProcess[i].PROCESS_NAME.ToString()) // { // status = true; // } // if (!status) // { // break; // } // } // if (status) // { // MessageBox.Show("Duplicate Flow name : " + flow.FLOW.FLOW_NAME, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); // return; // } //} ////for (int i = 0; i < _listFlowProcess.Count; i++) ////{ //// int checkFlow = 0; //// for (int j = 0; j < _listFlowProcess[i].PROCESS.Count; j++) //// { //// if (_listFlowProcess[i].PROCESS[j].ID == _flowInsert.PROCESS[j].ID) //// { //// checkFlow = checkFlow + 1; //// if (checkFlow == _flowInsert.PROCESS.Count) //// { //// MessageBox.Show("Have FlowProcess in Database " + //// "\n" + "Flow name : " + _listFlowProcess[i].FLOW.FLOW_NAME + //// "\n" + "Status : " + _listFlowProcess[i].FLOW.STATUS, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); //// return; //// } //// } //// else { break; } //// } ////} //Insert Flow. //if (_controllers.InsertFlow(_flowInsert)) { _frmMain.Load_SetFlow(); } FlowProcess_FlowProcessSubProperty flowProcess_FlowProcessSubProperty = new FlowProcess_FlowProcessSubProperty { listProcessFlowProperty = _listFlowProcess, listProcessSubFlowProperty = _listFlowProcessSub }; if (_flowProcess_FlowProcessSubController.Insert(flowProcess_FlowProcessSubProperty)) { _frmMain.Load_SetFlow(); btnBack.PerformClick(); } }