Exemplo n.º 1
0
        private void barButtonItem31_ItemClick(object sender, ItemClickEventArgs e)
        {
            CommFun.DW1.Text = "Receipt Entry";
            radPanel1.Controls.Clear();
            frmReceiptEntry frm = new frmReceiptEntry()
            {
                TopLevel = false, FormBorderStyle = FormBorderStyle.None, Dock = DockStyle.Fill, Radpanel = radPanel1
            };

            radPanel1.Controls.Add(frm);
            frm.Show();
            //frm.ShowDialog();
        }
Exemplo 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;
        }