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;
                //}
            }
        }
Esempio n. 2
0
        private void btnEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Buyer-Receipt-Edit") == false)
            {
                MessageBox.Show("You don't have Rights to Buyer-Receipt-Edit");
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            if (grdViewReceipt.FocusedRowHandle >= 0)
            {
                DataView dvData = new DataView(dt)
                {
                    RowFilter = String.Format("ReceiptId={0}", Convert.ToInt32(grdViewReceipt.GetFocusedRowCellValue("ReceiptId").ToString()))
                };
                int iReceiptId = Convert.ToInt32(grdViewReceipt.GetFocusedRowCellValue("ReceiptId").ToString());

                //if (iReceiptId != 0) BsfGlobal.ClearUserUsage("Buyer-Receipt-Edit", iReceiptId, BsfGlobal.g_sCRMDBName);

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

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

                if (BsfGlobal.g_bWorkFlow == true)
                {
                    m_oGridMasterView = grdViewReceipt;
                    m_oGridMasterView.FocusedRowHandle = grdViewReceipt.FocusedRowHandle;
                    m_iFocusRowId      = grdViewReceipt.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(frmCompEntry, "Receipt Entry");
                    if ((oPanel == null))
                    {
                        return;
                    }
                    oPanel.Controls.Clear();
                    oPanel.Controls.Add(frmCompEntry);
                    frmCompEntry.i_RowId = m_iFocusRowId;
                    frmCompEntry.Execute(iReceiptId, "E");
                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    m_oGridMasterView = grdViewReceipt;
                    m_oGridMasterView.FocusedRowHandle = grdViewReceipt.FocusedRowHandle;
                    m_iFocusRowId = grdViewReceipt.FocusedRowHandle;
                    CommFun.DW1.Hide();
                    CommFun.DW2.Text      = "Receipt Entry";
                    frmCompEntry.TopLevel = false;
                    CommFun.RP2.Controls.Clear();
                    frmCompEntry.FormBorderStyle = FormBorderStyle.None;
                    frmCompEntry.Dock            = DockStyle.Fill;
                    CommFun.RP2.Controls.Add(frmCompEntry);
                    frmCompEntry.i_RowId = m_iFocusRowId;
                    frmCompEntry.Execute(iReceiptId, "E");
                    CommFun.DW2.Show();
                }
            }
            Cursor.Current = Cursors.Default;
        }
Esempio n. 3
0
        private void btnEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (BsfGlobal.g_bWorkFlowDialog == true)
            {
                return;
            }
            if (grdPBRegView.FocusedRowHandle >= 0)
            {
                if (BsfGlobal.FindPermission("Progress Bill-Modify") == false)
                {
                    MessageBox.Show("You don't have Rights to Progress Bill-Modify");
                    return;
                }

                int    ProgRegId = Convert.ToInt32(grdPBRegView.GetFocusedRowCellValue("ProgRegId").ToString());
                int    CCId      = Convert.ToInt32(grdPBRegView.GetFocusedRowCellValue("CostCentreId").ToString());
                string sApprove  = CommFun.IsNullCheck(grdPBRegView.GetFocusedRowCellValue("Approve"), CommFun.datatypes.vartypestring).ToString();
                if (sApprove != "Partial" && sApprove != "Yes")
                {
                    string sUserName = BsfGlobal.CheckEntryUsed("Progress Bill-Modify", ProgRegId, BsfGlobal.g_sCRMDBName);
                    if (sUserName != "")
                    {
                        string sMsg = "The Entry is already Used by " + sUserName;
                        sMsg = sMsg + ", Do not Edit";
                        MessageBox.Show(sMsg);
                        return;
                    }
                }

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

                if (BsfGlobal.g_bWorkFlow == true)
                {
                    frmProg.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                    frmProg.TopLevel        = false;
                    frmProg.Dock            = DockStyle.Fill;

                    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;
                    frmProgressBillMaster frm = new frmProgressBillMaster();
                    DevExpress.XtraEditors.PanelControl oPanel = new DevExpress.XtraEditors.PanelControl();
                    oPanel = BsfGlobal.GetPanel(frm, "Progress Bill Entry");
                    if ((oPanel == null))
                    {
                        return;
                    }
                    oPanel.Controls.Clear();
                    frm.TopLevel        = false;
                    frm.FormBorderStyle = FormBorderStyle.None;
                    frm.Dock            = DockStyle.Fill;
                    oPanel.Controls.Add(frm);
                    frm.Execute(ProgRegId, CCId, "M", sApprove);
                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    ProgRegId = Convert.ToInt32(grdPBRegView.GetFocusedRowCellValue("ProgRegId").ToString());
                    frmProg   = new frmProgressBillMaster();
                    CommFun.DW1.Hide();
                    CommFun.DW2.Text = "ProgressBill Entry";
                    frmProg.TopLevel = false;
                    CommFun.RP2.Controls.Clear();
                    frmProg.FormBorderStyle = FormBorderStyle.None;
                    frmProg.Dock            = DockStyle.Fill;
                    CommFun.RP2.Controls.Add(frmProg);
                    frmProg.Execute(ProgRegId, CCId, "M", sApprove);
                    CommFun.DW2.Show();
                    //frmProg.Radpanel = Radpanel;
                    //Radpanel.Controls.Clear();
                    //Radpanel.Controls.Add(frmProg);
                    //frmProg.Execute(ProgRegId, CCId, "M", sApprove);
                }
            }
        }