コード例 #1
0
        public string InsertProductTitle(ProductTypeProperty dataItem)
        {
            sql = @"INSERT INTO `product_type` (   
                              ID
                            , PRODUCT_TITLE
                            , PRODUCT_SUB_CODE
                            , DESCRIPTION
                            , CREATE_USER
                                )                              
                                (
                              SELECT 1 + coalesce((SELECT max(Id) FROM product_type), 0) 
                            , 'dataItem.PRODUCT_TITLE'
                            , 'dataItem.PRODUCT_SUB_CODE'
                            , 'dataItem.DESCRIPTION'
                            , 'dataItem.CREATE_USER'
                            )";

            sql = sql.Replace("dataItem.PRODUCT_TITLE", dataItem.PRODUCT_TITLE);
            sql = sql.Replace("dataItem.PRODUCT_SUB_CODE", dataItem.PRODUCT_SUB_CODE);
            sql = sql.Replace("dataItem.DESCRIPTION", dataItem.DESCRIPTION);
            sql = sql.Replace("dataItem.CREATE_USER", dataItem.CREATE_USER);
            sql = sql.Replace("dataItem.LAST_USER", dataItem.LAST_USER);
            sql = sql.Replace("dataItem.CREATE_DATE", dataItem.CREATE_DATE);
            sql = sql.Replace("dataItem.LAST_DATE", dataItem.LAST_DATE);


            return(sql);
        }
コード例 #2
0
        public string SearchByProductSubCode(ProductTypeProperty dataItem)
        {
            sql = @"SELECT * FROM `product_type`
                    WHERE PRODUCT_SUB_CODE = 'dataItem.PRODUCT_SUB_CODE'";

            sql = sql.Replace("dataItem.PRODUCT_SUB_CODE", dataItem.PRODUCT_SUB_CODE);
            return(sql);
        }
コード例 #3
0
        public string SearchExistProductType(ProductTypeProperty dataItem)
        {
            sql = @"SELECT  ID                   
                    FROM product_type 
                    WHERE  PRODUCT_TITLE = 'dataItem.PRODUCT_TITLE'
                    ";

            sql = sql.Replace("dataItem.PRODUCT_TITLE", dataItem.PRODUCT_TITLE);
            return(sql);
        }
コード例 #4
0
        public string SearchProductTitle(ProductTypeProperty dataItem)
        {
            sql = @"SELECT * FROM `product_type`
                    WHERE PRODUCT_SUB_CODE = 'dataItem.PRODUCT_SUB_CODE'
                    AND PRODUCT_TITLE = 'dataItem.PRODUCT_TITLE'";

            sql = sql.Replace("dataItem.PRODUCT_SUB_CODE", dataItem.PRODUCT_SUB_CODE);
            sql = sql.Replace("dataItem.PRODUCT_TITLE", dataItem.PRODUCT_TITLE);
            return(sql);
        }
コード例 #5
0
        public List <SerialProductTypeProperty> SearchSerialProductType()
        {
            List <SerialProductTypeProperty> _result = new List <SerialProductTypeProperty>();

            try
            {
                _resultData = _models.SearchProductType();
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            ProductTypeProperty _productType = new ProductTypeProperty
                            {
                                ID            = _resultData.ResultOnDb.Rows[i]["PRODUCT_TYPE_ID"].ToString(),
                                PRODUCT_TITLE = _resultData.ResultOnDb.Rows[i]["PRODUCT_TITLE"].ToString()
                            };

                            SerialTypeProperty _serialType = new SerialTypeProperty
                            {
                                ID            = _resultData.ResultOnDb.Rows[i]["SERIAL_TYPE_ID"].ToString(),
                                SERIAL_FORMAT = _resultData.ResultOnDb.Rows[i]["SERIAL_FORMAT"].ToString(),
                                DETAIL        = _resultData.ResultOnDb.Rows[i]["DETAIL"].ToString()
                            };

                            SerialProductTypeProperty _serialProductType = new SerialProductTypeProperty
                            {
                                PRODUCT_TYPE = _productType,
                                SERIAL_TYPE  = _serialType
                            };

                            _result.Add(_serialProductType);
                        }
                    }
                }
                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);
            }
        }
コード例 #6
0
        //public List<ProductTypeProperty> Search()
        //{
        //    List<ProductTypeProperty> _result = new List<ProductTypeProperty>();
        //    try
        //    {
        //        _resultData = _models.Search();
        //        if (_resultData.StatusOnDb == true)
        //        {
        //            if (_resultData.ResultOnDb.Rows.Count > 0)
        //            {
        //                for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
        //                {

        //                }
        //            }
        //        }
        //        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 <ProductTypeProperty> SearchByProductSubCode(ProductTypeProperty dataItem)
        {
            List <ProductTypeProperty> _result = new List <ProductTypeProperty>();

            try
            {
                _resultData = _models.SearchByProductSubCode(dataItem);
                if (_resultData.StatusOnDb == true)
                {
                    if (_resultData.ResultOnDb.Rows.Count > 0)
                    {
                        for (int i = 0; i < _resultData.ResultOnDb.Rows.Count; i++)
                        {
                            ProductTypeProperty ProductTypeProperty = new ProductTypeProperty()
                            {
                                ID               = _resultData.ResultOnDb.Rows[i]["ID"].ToString(),
                                PRODUCT_TITLE    = _resultData.ResultOnDb.Rows[i]["PRODUCT_TITLE"].ToString(),
                                PRODUCT_SUB_CODE = _resultData.ResultOnDb.Rows[i]["PRODUCT_SUB_CODE"].ToString(),
                                DESCRIPTION      = _resultData.ResultOnDb.Rows[i]["DESCRIPTION"].ToString(),
                                CREATE_USER      = _resultData.ResultOnDb.Rows[i]["CREATE_USER"].ToString(),
                                LAST_USER        = _resultData.ResultOnDb.Rows[i]["LAST_USER"].ToString(),
                                CREATE_DATE      = _resultData.ResultOnDb.Rows[i]["CREATE_DATE"].ToString(),
                                LAST_DATE        = _resultData.ResultOnDb.Rows[i]["LAST_DATE"].ToString(),
                            };

                            _result.Add(ProductTypeProperty);
                        }
                    }
                }
                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);
            }
        }
コード例 #7
0
        private void Load_ProductType()
        {
            cmbProductType.Items.Clear();

            this.cmbProductType.SelectedIndex = -1;

            ProductTypeProperty _productTypeProperty = new ProductTypeProperty()
            {
                PRODUCT_SUB_CODE = (cmbProduct.SelectedItem as ComboboxItem).Value.ToString()
            };

            _listProductTypeProperty = _productTypeController.SearchByProductSubCode(_productTypeProperty);

            foreach (ProductTypeProperty data in _listProductTypeProperty)
            {
                ComboboxItem item = new ComboboxItem();
                item.Text  = data.PRODUCT_TITLE;
                item.Value = data.ID;
                cmbProductType.Items.Add(item);
            }
        }
コード例 #8
0
        private void Load_ProductType()
        {
            this.SetPage();

            this.lstProductType.DataSource = null;
            lstProductType.Items.Clear();

            ProductTypeProperty PRODUCT_TYPE = new ProductTypeProperty()
            {
                PRODUCT_SUB_CODE = (cmbProduct.SelectedItem as ComboboxItem).Value.ToString()
            };

            List <ProductTypeProperty> listProductTypeProperty = _productTypeController.SearchByProductSubCode(PRODUCT_TYPE);

            foreach (ProductTypeProperty data in listProductTypeProperty)
            {
                ListBoxItem item = new ListBoxItem();
                item.Text  = data.PRODUCT_TITLE;
                item.Value = data.ID;
                lstProductType.Items.Add(item);
            }
            ;
        }
コード例 #9
0
 public OutputOnDbProperty SearchByProductSubCode(ProductTypeProperty dataItem)
 {
     _resultData = _services.SearchByProductSubCode(dataItem);
     return(_resultData);
 }
コード例 #10
0
 set => SetValue(ProductTypeProperty, value);