Esempio n. 1
0
        private void GetValidToDate()
        {
            DataTable dtValid = new DataTable();

            m_iVendorId = Convert.ToInt32(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId").ToString());
            if (m_iVendorId > 0)
            {
                dtValid = m_oVendor.GetValidToDate(m_iVendorId);
                if (dtValid.Rows.Count > 0)
                {
                    txtVSupplier.Text   = dtValid.Rows[0][0].ToString();
                    txtVContractor.Text = dtValid.Rows[0][1].ToString();
                    txtVService.Text    = dtValid.Rows[0][2].ToString();
                }
                else
                {
                    txtVSupplier.Text   = "";
                    txtVContractor.Text = "";
                    txtVService.Text    = "";
                }
            }
            else
            {
                txtVSupplier.Text   = "";
                txtVContractor.Text = "";
                txtVService.Text    = "";
            }
        }
Esempio n. 2
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;
        }
Esempio n. 3
0
 private void GetGradeDetails()
 {
     m_iVendorId      = Convert.ToInt32(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId").ToString());
     m_tSupplyGrade   = new DataTable();
     m_tContractGrade = new DataTable();
     m_tServiceGrade  = new DataTable();
     m_tSupplyGrade   = m_oRegister.GetGradeName(m_iVendorId, "S");
     m_tContractGrade = m_oRegister.GetGradeName(m_iVendorId, "C");
     m_tServiceGrade  = m_oRegister.GetGradeName(m_iVendorId, "H");
     if (m_tSupplyGrade != null)
     {
         if (m_tSupplyGrade.Rows.Count > 0)
         {
             txtGSupplier.Text = m_tSupplyGrade.Rows[0][1].ToString();
         }
         else
         {
             txtGSupplier.Text = "";
         }
     }
     else
     {
         txtGSupplier.Text = "";
     }
     if (m_tContractGrade != null)
     {
         if (m_tContractGrade.Rows.Count > 0)
         {
             txtGContractor.Text = m_tContractGrade.Rows[0][1].ToString();
         }
         else
         {
             txtGContractor.Text = "";
         }
     }
     else
     {
         txtGContractor.Text = "";
     }
     if (m_tServiceGrade != null)
     {
         if (m_tServiceGrade.Rows.Count > 0)
         {
             txtGService.Text = m_tServiceGrade.Rows[0][1].ToString();
         }
         else
         {
             txtGService.Text = "";
         }
     }
     else
     {
         txtGService.Text = "";
     }
 }
Esempio n. 4
0
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (VendorView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.g_bAdminDB == true)
            {
                int    m_iVenId   = Convert.ToInt32(clsStatic.IsNullCheck(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId"), clsStatic.datatypes.vartypenumeric));
                string m_sVenName = (clsStatic.IsNullCheck(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorName"), clsStatic.datatypes.vartypestring)).ToString();

                DMS.frmDocument frm = new DMS.frmDocument();
                frm.Exe(19, m_iVenId, BsfGlobal.g_sVendorDBName, m_sVenName);
            }
        }
Esempio n. 5
0
 private void frmVendorMain_Activated(object sender, EventArgs e)
 {
     if (m_bAdd == true)
     {
         m_bAdd = false;
         PopulateVendor();
         VendorView.FocusedRowHandle = m_iRowId;
         if (VendorView.FocusedRowHandle < 0)
         {
             return;
         }
         int iVendorId = Convert.ToInt32(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId").ToString());
         lblVendor.Text = VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorName").ToString();
         PopulateRegDetails(iVendorId);
         VendorView.FocusedColumn = VendorView.VisibleColumns[0];
     }
 }
Esempio n. 6
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);
            }
        }
 private void GetFocusedRowData(int index)
 {
     if (index >= 0 && VendorView.RowCount > 0)
     {
         VendorView.FocusedRowHandle = index;
         btnSave.Enabled             = false;
         btnAddNew.Enabled           = btnModify.Enabled = btnDelete.Enabled = true;
         txtVendorCode.Text          = VendorView.GetRowCellValue(index, VendorManager.VendorDetails.VendorCode.ToString()).ToString();
         Vendor c = vendor.Get(int.Parse(txtVendorCode.Text));
         txtVendorName.Text = c.Vendor_Name;
         txtAddress.Text    = c.Address;
         City.EditValue     = c.City_Code;
         txtMobile1.Text    = c.Mobile1;
         txtMobile2.Text    = c.Mobile2;
         txtEmail.Text      = c.EMail;
         Group.EditValue    = c.GroupCode;
         txtNotes.Text      = c.Notes;
     }
 }
Esempio n. 8
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 = "";
        }
Esempio n. 9
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     m_iVendorId    = Convert.ToInt32(VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorId").ToString());
     lblVendor.Text = VendorView.GetRowCellValue(VendorView.FocusedRowHandle, "VendorName").ToString();
     EditVendor();
 }