Esempio n. 1
0
        private void btnMainEntry_ItemClick(object sender, ItemClickEventArgs e)
        {
            CommFun.DW1.Text = "Maintenance Entry";
            radPanel1.Controls.Clear();
            frmMaintenanceEntry frmCompEntry = new frmMaintenanceEntry();

            frmCompEntry.TopLevel        = false;
            frmCompEntry.FormBorderStyle = Alias.FormBorderStyle.None;
            frmCompEntry.Dock            = DockStyle.Fill;
            radPanel1.Controls.Add(frmCompEntry);
            frmCompEntry.Show();
        }
Esempio n. 2
0
        private void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (DGvTransView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("CRM-Maintenance-Bill-Modify") == false)
            {
                MessageBox.Show("You don't have Rights to CRM-Maintenance-Bill-Modify", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            //bar1.Visible = false;
            if (DGvTransView.FocusedRowHandle >= 0)
            {
                int MaintenanceId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("MaintenanceId").ToString());

                string Approve = CommFun.IsNullCheck(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring).ToString();
                if (Approve != "Partial" && Approve != "Yes")
                {
                    string sUserName = BsfGlobal.CheckEntryUsed("CRM-Maintenance-Bill-Modify", MaintenanceId, BsfGlobal.g_sCRMDBName);
                    if (sUserName != "")
                    {
                        string sMsg = "The Entry is already Used by " + sUserName;
                        sMsg = sMsg + ", Do not Edit";
                        MessageBox.Show(sMsg);
                        return;
                    }
                }

                frmMaintenanceEntry frmMain = new frmMaintenanceEntry()
                {
                    TopLevel = false, FormBorderStyle = System.Windows.Forms.FormBorderStyle.None, Dock = DockStyle.Fill
                };

                if (BsfGlobal.g_bWorkFlow == true)
                {
                    m_oGridMasterView = DGvTransView;
                    m_oGridMasterView.FocusedRowHandle = DGvTransView.FocusedRowHandle;
                    m_iFocusRowId      = DGvTransView.FocusedRowHandle;
                    BsfGlobal.g_bTrans = true;
                    m_oDW = (Telerik.WinControls.UI.Docking.DocumentWindow)BsfGlobal.g_oDock.ActiveWindow;
                    m_oDW.Hide();
                    BsfGlobal.g_bTrans = false;
                    Cursor.Current     = Cursors.WaitCursor;
                    PanelControl oPanel = new PanelControl();
                    oPanel = BsfGlobal.GetPanel(frmMain, "Maintenance Entry");
                    if ((oPanel == null))
                    {
                        return;
                    }
                    oPanel.Controls.Clear();
                    oPanel.Controls.Add(frmMain);
                    frmMain.Execute(MaintenanceId);
                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    m_oGridMasterView = DGvTransView;
                    m_oGridMasterView.FocusedRowHandle = DGvTransView.FocusedRowHandle;
                    m_iFocusRowId = DGvTransView.FocusedRowHandle;
                    CommFun.DW1.Hide();
                    CommFun.DW2.Text = "Maintenance Entry";
                    frmMain.TopLevel = false;
                    CommFun.RP2.Controls.Clear();
                    frmMain.FormBorderStyle = FormBorderStyle.None;
                    frmMain.Dock            = DockStyle.Fill;
                    CommFun.RP2.Controls.Add(frmMain);
                    frmMain.i_RowId = m_iFocusRowId;
                    frmMain.Execute(MaintenanceId);
                    CommFun.DW2.Show();
                    //Cursor.Current = Cursors.WaitCursor;
                    //panelControl1.Controls.Clear();
                    //panelControl1.Controls.Add(frmMain);
                    //frmMain.Execute(PBRegId);
                    //Cursor.Current = Cursors.Default;
                }
            }
        }