Exemplo n.º 1
0
        private void EditVendor()
        {
            if (BsfGlobal.FindPermission("Vendor-Master-Edit") == false)
            {
                MessageBox.Show("No Rights to Vendor-Master-Edit");
                return;
            }

            if (VendorView.FocusedRowHandle < 0)
            {
                return;
            }
            int iVendorId = Convert.ToInt32(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId").ToString());

            VendorName = VendorView.GetFocusedRowCellValue("VendorName").ToString();
            int i = VendorView.RowCount - 1;

            if (BsfGlobal.g_bWorkFlow == true)
            {
                //try { this.Parent.Controls.Owner.Hide(); }
                //catch { }
                m_oGridMasterView = VendorView;
                m_oGridMasterView.FocusedRowHandle = VendorView.FocusedRowHandle;
                iRowId = VendorView.FocusedRowHandle;
                BsfGlobal.g_bWorkFlow = true;
                frmMain frm = new frmMain();
                frm.m_lVendorId   = iVendorId;
                frm.m_sVendorName = VendorName;
                m_oDW             = (Telerik.WinControls.UI.Docking.DocumentWindow)BsfGlobal.g_oDock.ActiveWindow;
                m_oDW.Hide();
                DevExpress.XtraEditors.PanelControl oPanel = new DevExpress.XtraEditors.PanelControl();
                oPanel = BsfGlobal.GetPanel(frm, "Vendor Details");
                if (oPanel != null)
                {
                    oPanel.Controls.Clear();
                    frm.TopLevel        = false;
                    frm.FormBorderStyle = FormBorderStyle.None;
                    frm.Dock            = DockStyle.Fill;
                    oPanel.Controls.Add(frm);
                    frm.Execute();

                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;
                frmMain frm = new frmMain();
                frm.m_lVendorId   = iVendorId;
                frm.m_sVendorName = VendorName;
                frm.Execute();
                Cursor.Current = Cursors.Default;
            }
            m_bAdd   = true;
            m_iRowId = VendorView.FocusedRowHandle;
        }
Exemplo n.º 2
0
        private void VendorView_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            if (VendorView.FocusedRowHandle < 0)
            {
                return;
            }
            if (VendorView.RowCount == 1)
            {
                int iVendorId = Convert.ToInt32(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId").ToString());

                lblVendor.Text = VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorName").ToString();
                VendorName     = VendorView.GetFocusedRowCellValue("VendorName").ToString();
                PopulateRegDetails(iVendorId);
                GetGradeDetails();
                GetValidToDate();
                PopulateVendorGeneral(iVendorId);
            }
        }
Exemplo n.º 3
0
        private void VendorView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            if (e.FocusedRowHandle < 0)
            {
                return;
            }
            int iVendorId = Convert.ToInt32(VendorView.GetRowCellValue(e.FocusedRowHandle, "VendorId").ToString());

            lblVendor.Text = VendorView.GetRowCellValue(e.FocusedRowHandle, "VendorName").ToString();
            VendorName     = VendorView.GetFocusedRowCellValue("VendorName").ToString();
            PopulateRegDetails(iVendorId);
            GetGradeDetails();
            GetValidToDate();
            PopulateVendorGeneral(iVendorId);
            BsfGlobal.ClearUserUsage("Vendor-Master-Edit", iVendorId, BsfGlobal.g_sVendorDBName);
            //GetGradeDetails();
            //if (m_tSupplyGrade == null) txtGSupplier.Text = "";
            //if (m_tContractGrade == null) txtGContractor.Text = "";
            //if (m_tServiceGrade == null) txtGService.Text = "";
        }