Exemplo n.º 1
0
        //btnUpdate
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            GridView gridView = gridProduct.FocusedView as GridView;

            Model.PRODUCT obj = new Model.PRODUCT();

            obj.PRODUCT_ID    = Convert.ToInt32(gridView.GetFocusedRowCellValue("PRODUCT_ID").ToString());
            obj.PRODUCT_CODE  = gridView.GetFocusedRowCellValue("PRODUCT_CODE").ToString();
            obj.PRODUCT_NAME  = gridView.GetFocusedRowCellValue("PRODUCT_NAME").ToString();
            obj.CATEGORY_ID   = Convert.ToInt32(gridView.GetFocusedRowCellValue("CATEGORY_ID").ToString());
            obj.UNIT          = gridView.GetFocusedRowCellValue("UNIT").ToString();
            obj.SELLING_PRICE = Convert.ToInt32(gridView.GetFocusedRowCellValue("SELLING_PRICE").ToString());
            obj.COST_PRICE    = Convert.ToInt32(gridView.GetFocusedRowCellValue("COST_PRICE").ToString());
            obj.SALE_AMOUNT   = Convert.ToInt32(gridView.GetFocusedRowCellValue("SALE_AMOUNT").ToString());
            obj.DESCRIPTION   = gridView.GetFocusedRowCellValue("DESCRIPTION").ToString();
            obj.ORIGIN        = gridView.GetFocusedRowCellValue("ORIGIN").ToString();
            obj.DESCRIPTION   = gridView.GetFocusedRowCellValue("DESCRIPTION").ToString();
            obj.PRODUCER      = gridView.GetFocusedRowCellValue("PRODUCER").ToString();

            //frmAddProduct frmAdd = new frmAddProduct(preProduct, obj);
            //frmAdd.ShowDialog();
            frmAddProduct frmAdd = new frmAddProduct(preProduct, obj, this);

            frmAdd.WindowState     = FormWindowState.Maximized;
            frmAdd.FormBorderStyle = FormBorderStyle.None;
            frmAdd.MdiParent       = this.MdiParent;
            frmAdd.Dock            = DockStyle.Fill;
            frmAdd.Show();
        }
Exemplo n.º 2
0
        private void btnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //frmAddProduct frmAdd = new frmAddProduct(preProduct);
            //frmAdd.ShowDialog();
            frmAddProduct frmAdd = new frmAddProduct(preProduct, this);

            frmAdd.WindowState     = FormWindowState.Maximized;
            frmAdd.FormBorderStyle = FormBorderStyle.None;
            frmAdd.MdiParent       = this.MdiParent;
            frmAdd.Dock            = DockStyle.Fill;
            frmAdd.Show();
        }