Example #1
0
        /// <summary>
        /// 조회 버튼 이벤드
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Search(object sender, EventArgs e)
        {
            try
            {
                if (((FrmMAIN)this.MdiParent).ActiveMdiChild == this)
                {
                    ITEM_VO vo = new ITEM_VO();
                    vo.ITEM_NAME        = ITEM_NAME.Text;
                    vo.ITEM_STND        = ITEM_STND.Text;
                    vo.ITEM_COM_REORDER = ITEM_COM_REORDER.Text;
                    vo.ITEM_COM_DLVR    = ITEM_COM_DLVR.Text;
                    vo.ITEM_WRHS_IN     = ITEM_WRHS_IN.Text;
                    vo.ITEM_WRHS_OUT    = ITEM_WRHS_OUT.Text;
                    vo.ITEM_MANAGER     = ITEM_MANAGER.Text;
                    vo.ITEM_TYP         = ITEM_TYP.Text;
                    vo.ITEM_USE_YN      = ITEM_USE_YN.Text;

                    dgvitem.DataSource = null;
                    ItemService item = new ItemService();
                    dgvitem.DataSource = item.GetSearchItem(vo);
                }
            }
            catch (Exception err)
            {
                this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}");
            }
        }
Example #2
0
        public List <ITEM_VO> GetSearchItem(ITEM_VO vo)
        {
            List <ITEM_VO> list = default;

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    AESSalt salt = new AESSalt();
                    cmd.Connection  = new SqlConnection(this.ConnectionString);
                    cmd.CommandText = "SP_GetSearchItem";
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@P_ITEM_NAME", vo.ITEM_NAME);
                    cmd.Parameters.AddWithValue("@P_ITEM_STND", vo.ITEM_STND);
                    cmd.Parameters.AddWithValue("@P_ITEM_COM_REORDER", vo.ITEM_COM_REORDER);
                    cmd.Parameters.AddWithValue("@P_ITEM_COM_DLVR", vo.ITEM_COM_DLVR);
                    cmd.Parameters.AddWithValue("@P_ITEM_WRHS_IN", vo.ITEM_WRHS_IN);
                    cmd.Parameters.AddWithValue("@P_ITEM_WRHS_OUT", vo.ITEM_WRHS_OUT);
                    cmd.Parameters.AddWithValue("@P_ITEM_MANAGER", vo.ITEM_MANAGER);
                    cmd.Parameters.AddWithValue("@P_ITEM_TYP", vo.ITEM_TYP);
                    cmd.Parameters.AddWithValue("@P_ITEM_USE_YN", vo.ITEM_USE_YN);

                    cmd.Connection.Open();
                    SqlDataReader reader = cmd.ExecuteReader();
                    list = Helper.DataReaderMapToList <ITEM_VO>(reader);
                    cmd.Connection.Close();
                    return(list);
                }
            }
            catch (Exception err)
            {
                return(list);
            }
        }
        public bool insertREORDERDETATILS(REORDERDETATILS_VO vo, ITEM_VO vo2, string id)
        {
            bool Result = false;

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = new SqlConnection(this.ConnectionString);
                    cmd.CommandText = $@"SP_insertREORDERDETATILS";
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@P_REORDER_DETAIL_QTY_GOOD", vo.REORDER_DETAIL_QTY_GOOD);
                    cmd.Parameters.AddWithValue("@P_REORDER_CODE", vo.REORDER);
                    cmd.Parameters.AddWithValue("@P_REORDER_QTY", vo2.ITEM_QTY_UNIT);
                    cmd.Parameters.AddWithValue("@P_ITEM_INCOME_YN", vo2.ITEM_INCOME_YN);
                    cmd.Parameters.AddWithValue("@P_ITEM_CODE", vo2.ITEM_CODE);
                    cmd.Parameters.AddWithValue("@P_ITEM_WRHS_IN", vo2.ITEM_WRHS_IN);
                    cmd.Parameters.AddWithValue("@P_SALES_WORK_ORDER_ID", id);
                    cmd.Connection.Open();
                    int iResult = cmd.ExecuteNonQuery();
                    cmd.Connection.Close();
                    return((iResult > 0) ? true : false);
                }
            }
            catch (Exception err)
            {
                string msg = err.Message;
                return(Result);
            }
        }
Example #4
0
        public string SaveItem(ITEM_VO vo, int code)
        {
            string result;

            try
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = new SqlConnection(this.ConnectionString);
                    cmd.CommandText = "SaveItem";
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@P_ITEM_CODE", vo.ITEM_CODE);                       //1
                    cmd.Parameters.AddWithValue("@P_ITEM_NAME", vo.ITEM_NAME);                       //2
                    cmd.Parameters.AddWithValue("@P_ITEM_STND", vo.ITEM_STND);                       //3
                    cmd.Parameters.AddWithValue("@P_ITEM_UNIT", vo.ITEM_UNIT);                       // 4
                    cmd.Parameters.AddWithValue("@P_ITEM_QTY_UNIT", vo.ITEM_QTY_UNIT);               //5

                    cmd.Parameters.AddWithValue("@P_ITEM_TYP", vo.ITEM_TYP);                         //6
                    cmd.Parameters.AddWithValue("@P_ITEM_INCOME_YN", vo.ITEM_INCOME_YN);             //7
                    cmd.Parameters.AddWithValue("@P_ITEM_PROCS_YN", vo.ITEM_PROCS_YN);               //8
                    cmd.Parameters.AddWithValue("@P_ITEM_XPORT_YN", vo.ITEM_XPORT_YN);               // 9
                    cmd.Parameters.AddWithValue("@P_ITEM_FREE_YN", vo.ITEM_FREE_YN);                 //10

                    cmd.Parameters.AddWithValue("@P_ITEM_COM_DLVR", vo.ITEM_COM_DLVR);               //11
                    cmd.Parameters.AddWithValue("@P_ITEM_COM_REORDER", vo.ITEM_COM_REORDER);         //12
                    cmd.Parameters.AddWithValue("@P_ITEM_WRHS_IN", vo.ITEM_WRHS_IN);                 //13
                    cmd.Parameters.AddWithValue("@P_ITEM_WRHS_OUT", vo.ITEM_WRHS_OUT);               //14
                    cmd.Parameters.AddWithValue("@P_ITEM_LEADTIME", vo.ITEM_LEADTIME);               //15

                    cmd.Parameters.AddWithValue("@P_ITEM_QTY_REORDER_MIN", vo.ITEM_QTY_REORDER_MIN); //16
                    cmd.Parameters.AddWithValue("@P_ITEM_QTY_STND", vo.ITEM_QTY_STND);               //17
                    cmd.Parameters.AddWithValue("@P_ITEM_QTY_SAFE", vo.ITEM_QTY_SAFE);               //18
                    cmd.Parameters.AddWithValue("@P_ITEM_MANAGE_LEVEL", vo.ITEM_MANAGE_LEVEL);       //19
                    cmd.Parameters.AddWithValue("@P_ITEM_MANAGER", vo.ITEM_MANAGER);                 //20

                    cmd.Parameters.AddWithValue("@P_ITEM_UNIT_CNVR", vo.ITEM_UNIT_CNVR);             //21
                    cmd.Parameters.AddWithValue("@P_ITEM_QTY_CNVR", vo.ITEM_QTY_CNVR);               //22
                    cmd.Parameters.AddWithValue("@P_ITEM_LAST_MDFR", vo.ITEM_LAST_MDFR);             //23
                    cmd.Parameters.AddWithValue("@P_ITEM_LAST_MDFY", vo.ITEM_LAST_MDFY);             //24
                    cmd.Parameters.AddWithValue("@P_ITEM_USE_YN", vo.ITEM_USE_YN);                   //25

                    cmd.Parameters.AddWithValue("@P_ITEM_DSCN_YN", vo.ITEM_DSCN_YN);                 //26
                    cmd.Parameters.AddWithValue("@P_ITEM_REORDER_TYP", vo.ITEM_REORDER_TYP);         //27
                    cmd.Parameters.AddWithValue("@P_ITEM_REMARK", vo.ITEM_REMARK);                   //28
                    cmd.Parameters.AddWithValue("@P_INSERT_YN", code);                               //29
                    cmd.Parameters.Add(new SqlParameter("@P_ReturnCode", SqlDbType.NVarChar, 5));    //30
                    cmd.Parameters["@P_ReturnCode"].Direction = ParameterDirection.Output;

                    cmd.Connection.Open();
                    cmd.ExecuteNonQuery();
                    cmd.Connection.Close();
                    result = cmd.Parameters["@P_ReturnCode"].Value.ToString();
                    return(result);
                }
            }
            catch (Exception err)
            {
                return(result = "C201");
            }
        }
Example #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            int a = 0;

            dgv2.EndEdit();
            ReorderService service = new ReorderService();

            foreach (DataGridViewRow item in dgv2.Rows)
            {
                if (Convert.ToBoolean(item.Cells[1].Value) == true)
                {
                    a++;
                    if (item.Cells[9].Value == null)
                    {
                        MessageBox.Show("입고할 품목의 수량을 입력해주세요");
                        return;
                    }
                }
            }
            if (a == 0)
            {
                MessageBox.Show("입고할 품목을 선택해주세요");
                return;
            }
            REORDERDETATILS_VO vo  = new REORDERDETATILS_VO();
            ITEM_VO            vo2 = new ITEM_VO();
            int su = 0;

            foreach (DataGridViewRow item in dgv2.Rows)
            {
                if (Convert.ToBoolean(item.Cells[1].Value) == true)
                {
                    vo2.ITEM_QTY_UNIT          = Convert.ToInt32(item.Cells[8].Value);
                    vo2.ITEM_CODE              = item.Cells[3].Value.ToString();
                    vo2.ITEM_INCOME_YN         = item.Cells[13].Value.ToString();
                    vo2.ITEM_WRHS_IN           = (item.Cells[14].Value == null) ? "R-01" : item.Cells[14].Value.ToString();
                    vo.REORDER_DETAIL_QTY_GOOD = Convert.ToInt32(item.Cells[9].Value);
                    vo.REORDER = Convert.ToInt32(item.Cells[2].Value);
                    string id = item.Cells[15].Value.ToString();
                    if (service.insertREORDERDETATILS(vo, vo2, id))
                    {
                        ;
                    }
                    {
                        su++;
                    }
                }
            }
            if (su > 0)
            {
                DataGridViewBinding2();
                MessageBox.Show("입고대기가 완료 되었습니다.");
            }
        }
Example #6
0
 /// <summary>
 /// 업데이트 팝업시 해당 코드 정보가져오는 메서드
 /// </summary>
 /// <param name="code"></param>
 private void GetItem(string code)
 {
     try
     {
         ItemService item = new ItemService();
         ITEM_VO     vo   = item.GetItem(code);
         ITEM_CODE.Text              = vo.ITEM_CODE;
         ITEM_CODE.Enabled           = false;
         ITEM_NAME.Text              = vo.ITEM_NAME;
         ITEM_STND.Text              = vo.ITEM_STND;
         ITEM_UNIT.Text              = vo.ITEM_UNIT;
         ITEM_QTY_UNIT.Text          = vo.ITEM_QTY_UNIT.ToString();
         ITEM_TYP.Text               = vo.ITEM_TYP;
         ITEM_INCOME_YN.Text         = vo.ITEM_INCOME_YN;
         ITEM_PROCS_YN.Text          = vo.ITEM_PROCS_YN;
         ITEM_XPORT_YN.Text          = vo.ITEM_XPORT_YN;
         ITEM_FREE_YN.Text           = vo.ITEM_FREE_YN;
         ITEM_COM_DLVR.Text          = vo.ITEM_COM_DLVR;
         ITEM_COM_REORDER.Text       = vo.ITEM_COM_REORDER;
         ITEM_WRHS_IN.SelectedValue  = vo.ITEM_WRHS_IN;
         ITEM_WRHS_OUT.SelectedValue = vo.ITEM_WRHS_OUT;
         ITEM_LEADTIME.Text          = vo.ITEM_LEADTIME.ToString();
         ITEM_QTY_REORDER_MIN.Text   = vo.ITEM_QTY_REORDER_MIN.ToString();
         ITEM_QTY_STND.Text          = vo.ITEM_QTY_STND.ToString();
         ITEM_QTY_SAFE.Text          = vo.ITEM_QTY_SAFE.ToString();
         ITEM_MANAGE_LEVEL.Text      = vo.ITEM_MANAGE_LEVEL;
         ITEM_MANAGER.Text           = vo.ITEM_MANAGER;
         ITEM_UNIT_CNVR.Text         = vo.ITEM_UNIT_CNVR;
         ITEM_QTY_CNVR.Text          = vo.ITEM_QTY_CNVR.ToString();
         ITEM_USE_YN.Text            = vo.ITEM_USE_YN;
         ITEM_DSCN_YN.Text           = vo.ITEM_DSCN_YN;
         ITEM_REORDER_TYP.Text       = vo.ITEM_REORDER_TYP;
         ITEM_REMARK.Text            = vo.ITEM_REMARK;
     }
     catch (Exception err)
     {
         this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}");
     }
 }
        internal bool insertREORDERDETATILS(REORDERDETATILS_VO vo, ITEM_VO vo2, string id)
        {
            REORDERDAC dac = new REORDERDAC();

            return(dac.insertREORDERDETATILS(vo, vo2, id));
        }
Example #8
0
 /// <summary>
 /// 입력 버튼 이벤트
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         if (ITEM_CODE.Text.Length < 4)
         {
             MessageBox.Show("품목은 4자리 이상 입력해주세여야 됨니다.");
             return;
         }
         if (ITEM_NAME.Text.Length < 1 || ITEM_UNIT.Text.Length < 1 || ITEM_TYP.Text.Length < 1 || ITEM_INCOME_YN.Text.Length < 1 || ITEM_PROCS_YN.Text.Length < 1 || ITEM_XPORT_YN.Text.Length < 1 || ITEM_USE_YN.Text.Length < 1)
         {
             MessageBox.Show("필수 입력사항을 입력해주세요.");
             return;
         }
         ITEM_VO vo = new ITEM_VO();
         vo.ITEM_CODE            = ITEM_CODE.Text;
         vo.ITEM_NAME            = ITEM_NAME.Text;
         vo.ITEM_STND            = ITEM_STND.Text;
         vo.ITEM_UNIT            = ITEM_UNIT.Text;
         vo.ITEM_QTY_UNIT        = (ITEM_QTY_UNIT.Text.Length < 1) ? 1 : int.Parse(ITEM_QTY_UNIT.Text);
         vo.ITEM_TYP             = ITEM_TYP.Text;
         vo.ITEM_INCOME_YN       = ITEM_INCOME_YN.Text;
         vo.ITEM_PROCS_YN        = ITEM_PROCS_YN.Text;
         vo.ITEM_XPORT_YN        = ITEM_XPORT_YN.Text;
         vo.ITEM_FREE_YN         = ITEM_FREE_YN.Text;
         vo.ITEM_COM_DLVR        = ITEM_COM_DLVR.Text;
         vo.ITEM_COM_REORDER     = ITEM_COM_REORDER.Text;
         vo.ITEM_WRHS_IN         = ITEM_WRHS_IN.SelectedValue.ToString();
         vo.ITEM_WRHS_OUT        = ITEM_WRHS_OUT.SelectedValue.ToString();
         vo.ITEM_LEADTIME        = (ITEM_LEADTIME.Text.Length < 1) ? 1 : int.Parse(ITEM_LEADTIME.Text);
         vo.ITEM_QTY_REORDER_MIN = (ITEM_QTY_REORDER_MIN.Text.Length < 1) ? 0 : int.Parse(ITEM_QTY_REORDER_MIN.Text);
         vo.ITEM_QTY_STND        = (ITEM_QTY_STND.Text.Length < 1) ? 1 : int.Parse(ITEM_QTY_STND.Text);
         vo.ITEM_QTY_SAFE        = (ITEM_QTY_SAFE.Text.Length < 1) ? 1 : int.Parse(ITEM_QTY_SAFE.Text);
         vo.ITEM_MANAGE_LEVEL    = ITEM_MANAGE_LEVEL.Text;
         vo.ITEM_MANAGER         = ITEM_MANAGER.Text;
         vo.ITEM_UNIT_CNVR       = ITEM_UNIT_CNVR.Text;
         vo.ITEM_QTY_CNVR        = (ITEM_QTY_CNVR.Text.Length < 1) ? 1 : int.Parse(ITEM_QTY_CNVR.Text);
         vo.ITEM_LAST_MDFR       = ITEM_LAST_MDFR.Text;
         vo.ITEM_LAST_MDFY       = ITEM_LAST_MDFY.Value.ToShortDateString();
         vo.ITEM_USE_YN          = ITEM_USE_YN.Text;
         vo.ITEM_DSCN_YN         = ITEM_DSCN_YN.Text;
         vo.ITEM_REORDER_TYP     = ITEM_REORDER_TYP.Text;
         vo.ITEM_REMARK          = ITEM_REMARK.Text;
         ItemService item   = new ItemService();
         string      result = item.SaveItem(vo, code);
         if (result == "C200")
         {
             MessageBox.Show("성공적으로 입력되었습니다.");
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         else if (result == "C201")
         {
             MessageBox.Show("품목이 중복되었습니다. 다시 입력해주세요");
         }
     }
     catch (Exception err)
     {
         this.Log.WriteError($"[[RECV {this.Name}]]:{err.Message}");
     }
 }
Example #9
0
        public string SaveItem(ITEM_VO vo, int code)
        {
            ITEMDAC dac = new ITEMDAC();

            return(dac.SaveItem(vo, code));
        }
Example #10
0
        public List <ITEM_VO> GetSearchItem(ITEM_VO vo)
        {
            ITEMDAC dac = new ITEMDAC();

            return(dac.GetSearchItem(vo));
        }