Beispiel #1
0
        public OutputOnDbProperty SearchPO(PurchaseOrderProperty dataItem)
        {
            OutputOnDbProperty IN_resultData = new OutputOnDbProperty();

            //## Check PO ######################################################################
            IN_resultData = this.CheckPo(dataItem);
            if (IN_resultData.StatusOnDb == true)
            {
                if (IN_resultData.ResultOnDb.Rows.Count <= 0)
                {
                    //Insert PO
                    resultData = this.InsertPO(dataItem);
                }
                else
                {
                    //Updata PO
                    resultData = this.UpdataPO(dataItem);
                }
            }
            else
            {
                return(IN_resultData);
            }

            return(resultData);
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        public OutputOnDbProperty SearchBySystemIdAndPurchaseId(CvSystemSpecificProperty dataItem)
        {
            string sql = _sqlFactory.SearchBySystemIdAndPurchaseId(dataItem);

            _resultData = base.SearchBySql(sql);
            return(_resultData);
        }
Beispiel #5
0
        public override OutputOnDbProperty Search(CvResonatorSettingProperty dataItem)
        {
            string sql = _sqlFactory.Search(dataItem);

            _resultData = base.SearchBySql(sql);
            return(_resultData);
        }
Beispiel #6
0
        public DataTable SearchOrderInThisYear(string product)
        {
            DataTable _result = new DataTable();

            try
            {
                OrderProperty dataItem = new OrderProperty {
                    Sub_Product = new SubProductProperty {
                        PRODUCT_SUB_NAME = product
                    }
                };

                _resultData = _models.SearchOrderInThisYear(dataItem);
                if (_resultData.StatusOnDb == true)
                {
                    DataTable tableMain = _resultData.ResultOnDb;
                    _resultData = _models.GetOrderActualInput();
                    if (_resultData.StatusOnDb == true)
                    {
                        DataTable tableOrderActualInput = _resultData.ResultOnDb;
                        var       JoinResult            = (from tableFFT_ORDER in tableMain.AsEnumerable()
                                                           join tableINPUT in tableOrderActualInput.AsEnumerable() on tableFFT_ORDER.Field <string>("FFT_ORDER_ID") equals tableINPUT.Field <string>("FFT_ORDER_ID") into tempJoin
                                                           from leftJoin in tempJoin.DefaultIfEmpty()
                                                           select new
                        {
                            FFT_ORDER_ID = tableFFT_ORDER.Field <string>("FFT_ORDER_ID"),
                            ORDER_DATE = tableFFT_ORDER.Field <string>("ORDER_DATE"),
                            INPUT_STATUS = (leftJoin == null ? 0 - tableFFT_ORDER.Field <int>("ORDER_QUANTITY") : (int)leftJoin.Field <decimal>("ACTUAL_INPUT") - tableFFT_ORDER.Field <int>("ORDER_QUANTITY")) < 0 ? "Incomplete" : "Complete",
                            ORDER_QUANTITY = tableFFT_ORDER.Field <int>("ORDER_QUANTITY"),
                            ACTUAL_INPUT = leftJoin == null ? 0 : (int)leftJoin.Field <decimal>("ACTUAL_INPUT"),
                            INPUT_DIFF = leftJoin == null ? 0 - tableFFT_ORDER.Field <int>("ORDER_QUANTITY") : (int)leftJoin.Field <decimal>("ACTUAL_INPUT") - tableFFT_ORDER.Field <int>("ORDER_QUANTITY"),
                            ORDER_TYPE_NAME = tableFFT_ORDER.Field <string>("ORDER_TYPE_NAME"),
                            PRODUCT_NAME = tableFFT_ORDER.Field <string>("PRODUCT_NAME"),
                            CUSTOMER_NAME = tableFFT_ORDER.Field <string>("CUSTOMER_NAME"),
                            WORK_ORDER = tableFFT_ORDER.Field <string>("WORK_ORDER"),
                            PART_NO = tableFFT_ORDER.Field <string>("PART_NO"),
                            SPEC_NO = tableFFT_ORDER.Field <string>("SPEC_NO"),
                            SHIPPING_DESTINATION = tableFFT_ORDER.Field <string>("SHIPPING_DESTINATION"),
                            CUSTOMER_REQUEST = tableFFT_ORDER.Field <string>("CUSTOMER_REQUEST"),
                        }).ToList();

                        string json = JsonConvert.SerializeObject(JoinResult);
                        _result = (DataTable)JsonConvert.DeserializeObject(json, (typeof(DataTable)));
                    }
                    else
                    {
                        MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(_result);
        }
Beispiel #7
0
        public string GetOrderQty(OrderProperty dataItem)
        {
            string _result = "0";

            try
            {
                _resultData = _models.SeachOrderQty(dataItem);
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        _result = _resultData.ResultOnDb.Rows[0]["ORDER_QUANTITY"].ToString();
                    }
                }
                else
                {
                    MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(_result);
        }
Beispiel #8
0
        public string GetEXP_OTP(EmpProperty dataItem, string OTP)
        {
            string _result = "";

            try
            {
                resultData = _models.SearchOTP(dataItem, OTP);
                if (resultData.StatusOnDb == true)
                {
                    if (resultData.ResultOnDb.Rows.Count > 0)
                    {
                        string EXP_OTP = resultData.ResultOnDb.Rows[0]["EXP_OTP"].ToString();
                        _result = EXP_OTP;
                    }
                }
                else
                {
                    MessageBox.Show(resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(_result);
        }
Beispiel #9
0
        public bool CheckEmpCompanyExist(EmpProperty dataItem)
        {
            bool _result = false;

            try
            {
                resultData = _models.SearchEmpCompany(dataItem);
                if (resultData.StatusOnDb == true)
                {
                    if (resultData.ResultOnDb.Rows.Count > 0)
                    {
                        if (resultData.ResultOnDb.Rows[0]["EMP_STATUS"].ToString() == "1")
                        {
                            _result = true;
                        }
                    }
                    else
                    {
                        MessageBox.Show("Couldn't find Employee ID", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                }
                else
                {
                    MessageBox.Show(resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }

            return(_result);
        }
Beispiel #10
0
        public ShipmentProperty SearchSerailShippingReturn(ShipmentProperty dataItem)
        {
            ShipmentProperty _result = new ShipmentProperty();

            try
            {
                _resultData = _models.SearchSerailShippingReturn(dataItem);
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            _result.SERIAL_NO     = _resultData.ResultOnDb.Rows[i]["SERIAL_NO"].ToString();
                            _result.ACTION        = _resultData.ResultOnDb.Rows[i]["ACTION"].ToString();
                            _result.PRODUCT_CODE  = _resultData.ResultOnDb.Rows[i]["PRODUCT_CODE"].ToString();
                            _result.SHIPMENT_DATE = _resultData.ResultOnDb.Rows[i]["SHIPMENT_DATE"].ToString();
                            //_test data
                            //_result.SHIPMENT_DATE ="10/01/1995";
                            _result.SHIPMENT_DATE_TXT = _resultData.ResultOnDb.Rows[i]["SHIPMENT_DATE_TXT"].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);
            }
        }
Beispiel #11
0
        public string GetDateTime()
        {
            string _result = "";

            try
            {
                resultData = _models.GetDatatime();
                if (resultData.StatusOnDb == true)
                {
                    if (resultData.ResultOnDb.Rows.Count > 0)
                    {
                        string dateTimeNow = resultData.ResultOnDb.Rows[0]["DATETIME_NOW"].ToString();
                        _result = dateTimeNow;
                    }
                }
                else
                {
                    MessageBox.Show(resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(_result);
        }
Beispiel #12
0
        public OutputOnDbProperty InsertFlow(FlowProcessProperty dataItem)
        {
            List <string> _listSQL = _sqlFactory.InsertFlow(dataItem);

            resultData = base.InsertBySqlList(_listSQL);
            return(resultData);
        }
Beispiel #13
0
        public List <ProcessProperty> SearchProcessAll()
        {
            List <ProcessProperty> _result = new List <ProcessProperty>();

            try
            {
                _resultData = _models.SearchProcessAll();
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            ProcessProperty _process = new ProcessProperty()
                            {
                                ID           = _resultData.ResultOnDb.Rows[i]["ID"].ToString(),
                                PROCESS_NAME = _resultData.ResultOnDb.Rows[i]["PROCESS_NAME"].ToString(),
                                INUSE        = _resultData.ResultOnDb.Rows[i]["INUSE"].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);
            }
        }
Beispiel #14
0
        public List <ResultProperty> SearchResultAll()
        {
            List <ResultProperty> _result = new List <ResultProperty>();

            try
            {
                _resultData = _models.SearchResultAll();
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            ResultProperty _resultInDB = new ResultProperty()
                            {
                                ID     = _resultData.ResultOnDb.Rows[i]["ID"].ToString(),
                                RESULT = _resultData.ResultOnDb.Rows[i]["RESULT"].ToString()
                            };
                            _result.Add(_resultInDB);
                        }
                    }
                }
                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);
            }
        }
Beispiel #15
0
        public override OutputOnDbProperty Search()
        {
            string sql = _sqlFactory.Search();

            _resultData = base.SearchBySql(sql);
            return(_resultData);
        }
Beispiel #16
0
        public EmpProperty GetEmpProperty(EmpProperty dataItem)
        {
            EmpProperty _result = new EmpProperty();

            try
            {
                resultData = _models.SearchEmpCompany(dataItem);
                if (resultData.StatusOnDb == true)
                {
                    if (resultData.ResultOnDb.Rows.Count > 0)
                    {
                        _result = new EmpProperty
                        {
                            code       = resultData.ResultOnDb.Rows[0]["EMP_ID"].ToString(),
                            name       = resultData.ResultOnDb.Rows[0]["EMP_NAME"].ToString(),
                            sername    = resultData.ResultOnDb.Rows[0]["EMP_SURNAME"].ToString(),
                            email      = resultData.ResultOnDb.Rows[0]["EMP_EMAIL"].ToString(),
                            startwork  = resultData.ResultOnDb.Rows[0]["START_WORK"].ToString(),
                            depertment = resultData.ResultOnDb.Rows[0]["DEPARTMENT"].ToString(),
                            position   = resultData.ResultOnDb.Rows[0]["POSITION"].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);
            }
        }
Beispiel #17
0
        public OutputOnDbProperty SearchByIpAddressSystem(CvSystemProperty dataItem)
        {
            string sql = _sqlFactory.SearchByIpAddressSystem(dataItem);

            _resultData = base.SearchBySql(sql);
            return(_resultData);
        }
Beispiel #18
0
        protected OutputOnDbProperty TransExecuteCommand(string sql)
        {
            try
            {
                userCommand.CommandText = sql;
                userCommand.CommandType = CommandType.Text;
                userCommand.ExecuteNonQuery();

                dataOutPut = new OutputOnDbProperty
                {
                    StatusOnDb  = true,
                    ClassOnDb   = "Class Name: TransOracleModels",
                    MethodOnDb  = "Method Name: TransExecuteCommand",
                    MessageOnDb = "",
                    ResultOnDb  = null
                };
            }
            catch (Exception er)
            {
                dataOutPut = new OutputOnDbProperty
                {
                    StatusOnDb  = false,
                    ClassOnDb   = "Class Name: TransOracleModels",
                    MethodOnDb  = "Method Name: TransExecuteCommand",
                    MessageOnDb = "Execute SQL Command Error ==> " + er.ToString(),
                    ResultOnDb  = null
                };
            }

            return(dataOutPut);
        }
Beispiel #19
0
        public string GetQtyHistory(OrderProperty dataItem)
        {
            string _result = "0";

            try
            {
                _resultData = _models.SearchOrderHistory(dataItem);
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        int Qty = 0;
                        int qtyOrderHistory;
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            qtyOrderHistory = Convert.ToInt32(_resultData.ResultOnDb.Rows[i]["QUANTITY"].ToString());
                            Qty             = Qty + qtyOrderHistory;
                        }
                        _result = Qty.ToString();
                    }
                }
                else
                {
                    MessageBox.Show(_resultData.MessageOnDb, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(_result);
        }
Beispiel #20
0
        protected OutputOnDbProperty TransConnection()
        {
            try
            {
                conTrans = new MySqlConnection(strConnection);
                conTrans.Open();
                trans = conTrans.BeginTransaction(IsolationLevel.ReadCommitted); //*** Start
                userCommand.Connection  = conTrans;
                userCommand.Transaction = trans;                                 //*** Command & Transaction ***//

                dataOutPut = new OutputOnDbProperty
                {
                    StatusOnDb  = true,
                    MessageOnDb = "Connect Database Success",
                    ClassOnDb   = "Class Name: TransOracleModels",
                    MethodOnDb  = "Method Name: TransConnection",
                    ResultOnDb  = null
                };
            }
            catch (Exception er)
            {
                dataOutPut = new OutputOnDbProperty
                {
                    StatusOnDb  = false,
                    ClassOnDb   = "Class Name: TransOracleModels",
                    MethodOnDb  = "Method Name: TransConnection",
                    MessageOnDb = "Connect Database Error ==> " + er.ToString(),
                    ResultOnDb  = null
                };
            }

            return(dataOutPut);
        }
Beispiel #21
0
        public DateTime GetDatetimeNow()
        {
            DateTime _result      = DateTime.Now;
            string   _datetimenow = "";

            try
            {
                _resultData = _models.GetDatetimeNow_InDB();
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        _datetimenow = _resultData.ResultOnDb.Rows[0]["DATETIME_NOW"].ToString();
                        _result      = Convert.ToDateTime(_datetimenow);
                    }
                }
                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);
            }
        }
Beispiel #22
0
        public List <PurchaseProperty> UsedPurchase(ShipmentProperty dataItem)
        {
            List <PurchaseProperty> _result = new List <PurchaseProperty>();

            try
            {
                _resultData = _models.UsedPurchase(dataItem);
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            PurchaseProperty _purchase = new PurchaseProperty();
                            _purchase.FLOW = new FlowProperty();

                            _purchase.PURCHASE_NO    = _resultData.ResultOnDb.Rows[i]["PURCHASE_NO"].ToString();
                            _purchase.FLOW.FLOW_NAME = _resultData.ResultOnDb.Rows[i]["FLOW_NAME"].ToString();

                            _result.Add(_purchase);
                        }
                    }
                }
                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 SearchBySystemId(CvSystemCommonProperty dataItem)
        {
            string sql = _sqlFactory.SearchBySystemId(dataItem);

            _resultData = base.SearchBySql(sql);
            return(_resultData);
        }
Beispiel #24
0
        protected OutputOnDbProperty DeleteBySql(string sql)
        {
            try
            {
                resultData = base.TransConnection();

                if (resultData.StatusOnDb == true)
                {
                    resultData = base.TransExecuteCommand(sql);

                    if (resultData.StatusOnDb == true)
                    {
                        base.TransCommit();
                        resultData.MessageOnDb = "Delete Data Success";
                    }
                    else
                    {
                        base.TransRolback();
                    }
                }
            }
            finally
            {
                base.TransClose();
            }

            return(resultData);
        }
Beispiel #25
0
        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);
            }
        }
Beispiel #26
0
 protected OutputOnDbProperty InsertBySqlList(List <string> sqlList)
 {
     try
     {
         resultData = base.TransConnection();
         if (resultData.StatusOnDb == true)
         {
             foreach (string sql in sqlList)
             {
                 resultData = base.TransExecuteCommand(sql);
                 if (resultData.StatusOnDb == false)
                 {
                     base.TransRolback();
                     return(resultData);
                 }
             }
             base.TransCommit();
             resultData.MessageOnDb = "Save Data Success";
         }
     }
     finally
     {
         base.TransClose();
     }
     return(resultData);
 }
Beispiel #27
0
        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);
            }
        }
Beispiel #28
0
        public override OutputOnDbProperty Insert(CvSystemProperty dataItem)
        {
            string sql = _sqlFactory.Insert(dataItem);

            _resultData = base.InsertBySql(sql);
            return(_resultData);
        }
Beispiel #29
0
        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);
            }
        }
        public OutputOnDbProperty SearchByPurchaseId(CvResonatorSettingStepProperty dataItem)
        {
            string sql = _sqlFactory.SearchByPurchaseId(dataItem);

            _resultData = base.SearchBySql(sql);
            return(_resultData);
        }