Exemplo n.º 1
0
        private void BORPop_Load(object sender, EventArgs e)
        {
            R_survice = new ResourceService();
            #region 콤보박스 바인딩
            common_service = new CommonCodeService();
            common_list    = common_service.GetCommonCodeAll();
            {
                //공정
                var mCode = (from item in common_list
                             where item.common_type == "route"
                             select item).ToList();

                ComboUtil.ComboBinding <CommonVO>(cboRoute, mCode, "common_value", "common_name", "미선택");
            }
            {
                //사용유무
                var mCode = (from item in common_list
                             where item.common_type == "user_flag"
                             select item).ToList();

                ComboUtil.ComboBinding <CommonVO>(cboYN, mCode, "common_value", "common_name");
            }
            R_survice = new ResourceService();
            List <MachineVO> lst = R_survice.GetMachineAll();
            ComboUtil.ComboBinding <MachineVO>(cboM_name, lst, "m_id", "m_name", "미선택");
            ProductService   product_service = new ProductService();
            List <ProductVO> list            = product_service.GetAllProducts();
            ComboUtil.ComboBinding <ProductVO>(cboP_Name, list, "product_id", "product_name", "미선택");
            #endregion

            if (mode == EditMode.Update)
            {
                R_survice         = new ResourceService();
                vo                = R_survice.GetBORByID(Convert.ToInt32(lblID.Text), lblRoute.Text);
                lblID.Text        = vo.bor_id.ToString();
                cboP_Name.Text    = vo.product_name;
                cboM_name.Text    = vo.m_name;
                cboYN.Text        = vo.bor_yn;
                cboRoute.Text     = vo.common_name;
                txtComment.Text   = vo.bor_comment;
                txtReadyTime.Text = vo.bor_readytime.ToString();
                txtTactTime.Text  = vo.bor_tacktime.ToString();
            }
        }
Exemplo n.º 2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            dataGridView1.Columns.Clear();
            BORDB_VO vo = new BORDB_VO();

            vo.product_name = txtItem.Text;
            if (cboProcess.Text == "미선택")
            {
                vo.common_name = "";
            }
            else
            {
                vo.common_name = cboProcess.Text;
            }
            vo.m_name = txtFacility.Text;

            List <BORDB_VO> list = service.BOR_Search(vo);

            if (list == null)
            {
                return;
            }
            else
            {
                dataGridView1.DataSource = null;
                dgvColumnSet();
                dataGridView1.DataSource = list;
            }

            if (dataGridView1.Rows.Count <= 0)
            {
                SetBottomStatusLabel("조회에 실패하였습니다. 다시 시도하여 주십시오.");
            }
            else
            {
                SetBottomStatusLabel("조회가 완료되었습니다.");
            }
        }
Exemplo n.º 3
0
        public List <BORDB_VO> BOR_Search(BORDB_VO vo)
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("select     b.bor_id as bor_id,	a.product_id as bom_id,	a.product_codename as product_codename,	a.product_name as product_name , ");
                sb.Append("c.common_value as common_type ,	c.common_name as common_name,	d.m_code as m_code,	d.m_name as m_name,	b.bor_tacktime as bor_tacktime , ");
                sb.Append(" b.bor_readytime as bor_readytime,	b.bor_yn as bor_yn,	b.bor_comment as bor_comment from tbl_product a inner join tbl_bor b on ");
                sb.Append(" a.product_id = b.product_id inner join tbl_common_code c on c.common_value = b.bor_route and c.common_type = 'route' inner join  ");
                sb.Append(" tbl_machine d on d.m_id = b.m_id where 1 = 1   ");

                cmd.Connection = new SqlConnection(this.ConnectionString);

                if (vo.product_name != "")
                {
                    cmd.Parameters.AddWithValue("@product_name", vo.product_name);
                    sb.Append(" and product_name = @product_name");
                }
                if (vo.common_name != "")
                {
                    cmd.Parameters.AddWithValue("@common_name", vo.common_name);
                    sb.Append(" and common_name = @common_name");
                }
                if (vo.m_name != "")
                {
                    cmd.Parameters.AddWithValue("@m_name", vo.m_name);
                    sb.Append("  and m_name = @m_name");
                }
                cmd.CommandText = sb.ToString();
                cmd.Connection.Open();
                SqlDataReader   reader = cmd.ExecuteReader();
                List <BORDB_VO> list   = Helper.DataReaderMapToList <BORDB_VO>(reader);
                cmd.Connection.Close();
                return(list);
            }
        }
Exemplo n.º 4
0
 public List <BORDB_VO> BOR_Search(BORDB_VO vo)
 {
     return(dac.BOR_Search(vo));
 }