Example #1
0
        public bool UpdatePriceInfo(PriceInfoVO VO)
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.Connection  = new SqlConnection(this.ConnectionString);
                cmd.CommandText = "UpdatePriceInfo";
                cmd.CommandType = CommandType.StoredProcedure;


                cmd.Parameters.AddWithValue("@price_id", VO.price_id);
                cmd.Parameters.AddWithValue("@product_id", VO.product_id);
                cmd.Parameters.AddWithValue("@company_id", VO.company_id);
                cmd.Parameters.AddWithValue("@price_present", VO.price_present);
                cmd.Parameters.AddWithValue("@price_past", VO.price_past);
                cmd.Parameters.AddWithValue("@price_sdate", VO.price_sdate);
                cmd.Parameters.AddWithValue("@price_edate", VO.price_edate);
                cmd.Parameters.AddWithValue("@price_yn", VO.price_yn);
                cmd.Parameters.AddWithValue("@price_uadmin", VO.price_uadmin);
                cmd.Parameters.AddWithValue("@price_udate", VO.price_udate);
                cmd.Parameters.AddWithValue("@price_comment", VO.price_comment);

                cmd.Connection.Open();
                var successRow = cmd.ExecuteNonQuery();
                cmd.Connection.Close();
                return(successRow > 0);
            }
        }
Example #2
0
 public SUPMPop(EditMode edit, List <PriceInfoVO> list = null, PriceInfoVO vo = null)
 {
     InitializeComponent();
     if (edit == EditMode.Insert)
     {
         this.Text = "영업 단가 등록";
         this.edit = EditMode.Insert;
         this.list = list;
     }
     else if (edit == EditMode.Update)
     {
         this.Text = "영업 단가 수정";
         this.edit = EditMode.Update;
         this.vo   = vo;
     }
 }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            PriceInfoVO vo = new PriceInfoVO();

            foreach (DataGridViewRow row in this.dgvMUPM.SelectedRows)
            {
                vo = row.DataBoundItem as PriceInfoVO;
            }

            MUPMPop frm = new MUPMPop(MUPMPop.EditMode.Update, null, vo);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                price_service = new PriceService();
                List <PriceInfoVO> newPricelist = price_service.GetPriceInfo("COOPERATIVE");    //등록후 다시 조회
                dgvMUPM.DataSource = newPricelist;
                dgvMUPM.ClearSelection();
                SetBottomStatusLabel("자재단가 수정이 완료되었습니다.");
            }
        }
Example #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            List <PriceInfoVO> list = new List <PriceInfoVO>();

            foreach (DataGridViewRow row in this.dgvMUPM.Rows)
            {
                PriceInfoVO vo = new PriceInfoVO();
                vo = row.DataBoundItem as PriceInfoVO;
                list.Add(vo);
            }
            MUPMPop frm = new MUPMPop(MUPMPop.EditMode.Insert, list);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                price_service = new PriceService();
                List <PriceInfoVO> new_priceinfo_list = price_service.GetPriceInfo("COOPERATIVE");    //등록후 다시 조회
                dgvMUPM.DataSource = new_priceinfo_list;
                SetBottomStatusLabel("신규 자재단가가 등록되었습니다.");
            }
        }
Example #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (edit == EditMode.Insert)
            {
                if (MessageBox.Show("등록하시겠습니까?", "신규등록", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    price_service = new PriceService();
                    PriceInfoVO vo = new PriceInfoVO();

                    vo.product_id    = Convert.ToInt32(cboProduct.SelectedValue);
                    vo.company_id    = Convert.ToInt32(cboCompany.SelectedValue);
                    vo.price_present = Convert.ToDecimal(txtCurrentPrice.Text);
                    vo.price_past    = Convert.ToDecimal(txtBeforePrice.Text);
                    vo.price_sdate   = dtpStartDate.Value.ToString("yyyy-MM-dd");
                    vo.price_edate   = txtEndDate.Text;
                    vo.price_udate   = txtModifyDate.Text;
                    //vo.price_uadmin = txtModifier.Text;
                    vo.price_yn      = cboIsUsed.SelectedValue.ToString();
                    vo.price_comment = txtNote.Text;

                    try
                    {
                        bool bResult = price_service.AddPriceInfo(vo);
                        if (bResult)
                        {
                            if (MessageBox.Show("등록되었습니다.", "등록완료", MessageBoxButtons.OK) == DialogResult.OK)
                            {
                                this.Close();
                            }
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                        if (MessageBox.Show("등록에 실패하였습니다.", "등록 실패", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                        {
                            return;
                        }
                    }
                }
            }
            else if (edit == EditMode.Update)
            {
                if (MessageBox.Show("수정하시겠습니까?", "자재 단가 수정", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    price_service = new PriceService();
                    PriceInfoVO vo = new PriceInfoVO();


                    vo.price_id      = this.vo.price_id;
                    vo.product_id    = Convert.ToInt32(cboProduct.SelectedValue);
                    vo.company_id    = Convert.ToInt32(cboCompany.SelectedValue);
                    vo.price_present = Convert.ToDecimal(txtCurrentPrice.Text);
                    vo.price_past    = Convert.ToDecimal(txtBeforePrice.Text);
                    vo.price_sdate   = dtpStartDate.Value.ToString("yyyy-MM-dd");
                    vo.price_edate   = txtEndDate.Text;
                    vo.price_udate   = txtModifyDate.Text;
                    // vo.price_uadmin = txtModifier.Text;
                    vo.price_yn      = cboIsUsed.SelectedValue.ToString();
                    vo.price_comment = txtNote.Text;



                    try
                    {
                        bool bResult = price_service.UpdatePriceInfo(vo);
                        if (bResult)
                        {
                            if (MessageBox.Show("수정되었습니다.", "수정완료", MessageBoxButtons.OK) == DialogResult.OK)
                            {
                                this.Close();
                            }
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                        if (MessageBox.Show("수정에 실패하였습니다.", "수정 실패", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                        {
                            return;
                        }
                    }
                }
            }
        }
Example #6
0
        public bool UpdatePriceInfo(PriceInfoVO vo)
        {
            PriceDac dac = new PriceDac();

            return(dac.UpdatePriceInfo(vo));
        }
Example #7
0
        public bool AddPriceInfo(PriceInfoVO vo)
        {
            PriceDac dac = new PriceDac();

            return(dac.AddPriceInfo(vo));
        }