Beispiel #1
0
        private void barButtonItem4_ItemClick_1(object sender, ItemClickEventArgs e)
        {
            CommFun.DW1.Text = "Service Order Bill";
            radPanel1.Controls.Clear();
            frmServiceOrderBill frmSE = new frmServiceOrderBill();

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

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

                frmServiceOrderBill frmProg = new frmServiceOrderBill()
                {
                    TopLevel = false, FormBorderStyle = System.Windows.Forms.FormBorderStyle.None, Dock = DockStyle.Fill
                };
                if (BsfGlobal.g_bWorkFlow == true)
                {
                    m_oGridMasterView = DGvTransView;
                    m_oGridMasterView.FocusedRowHandle = 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(frmProg, "Service Order Bill");
                    if ((oPanel == null))
                    {
                        return;
                    }
                    oPanel.Controls.Clear();
                    oPanel.Controls.Add(frmProg);
                    frmProg.Execute(argWORegId);
                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    argWORegId = Convert.ToInt32(DGvTransView.GetRowCellValue(DGvTransView.FocusedRowHandle, "RegBillId"));
                    CommFun.DW1.Hide();
                    frmProg          = new frmServiceOrderBill();
                    CommFun.DW2.Text = "Service Order Bill";
                    frmProg.TopLevel = false;
                    CommFun.RP2.Controls.Clear();
                    frmProg.FormBorderStyle = FormBorderStyle.None;
                    frmProg.Dock            = DockStyle.Fill;
                    CommFun.RP2.Controls.Add(frmProg);
                    frmProg.Execute(argWORegId);
                    CommFun.DW2.Show();
                }
                //if (BsfGlobal.g_bWorkFlow == true)
                //{
                //    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(frmService, "Service Order Bill");
                //    if ((oPanel == null))
                //        return;
                //    oPanel.Controls.Clear();
                //    oPanel.Controls.Add(frmService);
                //    frmService.Execute(argWORegId);
                //    oPanel.Visible = true;
                //    Cursor.Current = Cursors.Default;
                //}
                //else
                //{
                //    Cursor.Current = Cursors.WaitCursor;
                //    panelControl1.Controls.Clear();
                //    panelControl1.Controls.Add(frmService);
                //    frmService.Execute(argWORegId);
                //    Cursor.Current = Cursors.Default;
                //}
            }
        }