Beispiel #1
0
        private void btmPMSEntry_ItemClick(object sender, ItemClickEventArgs e)
        {
            CommFun.DW1.Text = "PMS Receipt Entry";
            radPanel1.Controls.Clear();
            frmPMSReceiptEntry frmEntry = new frmPMSReceiptEntry();

            frmEntry.TopLevel        = false;
            frmEntry.FormBorderStyle = Alias.FormBorderStyle.None;
            frmEntry.Dock            = DockStyle.Fill;
            radPanel1.Controls.Add(frmEntry);
            frmEntry.Show();
        }
        private void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Buyer-Receipt-Edit") == false)
            {
                MessageBox.Show("You don't have Rights to Buyer-Receipt-Edit");
                return;
            }
            DataView dvData;

            //bar1.Visible = true;
            if (grdViewReceipt.FocusedRowHandle >= 0)
            {
                dvData = new DataView(dt)
                {
                    RowFilter = String.Format("ReceiptId={0}", Convert.ToInt32(grdViewReceipt.GetFocusedRowCellValue("ReceiptId").ToString()))
                };
                int BuyerId = Convert.ToInt32(grdViewReceipt.GetFocusedRowCellValue("ReceiptId").ToString());

                //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", BuyerId, BsfGlobal.g_sCRMDBName);
                //    if (sUserName != "")
                //    {
                //        string sMsg = "The Entry is already Used by " + sUserName;
                //        sMsg = sMsg + ", Do not Edit";
                //        MessageBox.Show(sMsg);
                //        return;
                //    }
                //}

                //int CCId = Convert.ToInt32(DGvTransView.GetFocusedRowCellValue("CostCentreId").ToString());
                frmPMSReceiptEntry frmCompEntry = new frmPMSReceiptEntry()
                {
                    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, "PMS Receipt Entry");
                    if ((oPanel == null))
                    {
                        return;
                    }
                    oPanel.Controls.Clear();
                    oPanel.Controls.Add(frmCompEntry);
                    frmCompEntry.i_RowId = m_iFocusRowId;
                    frmCompEntry.Execute(BuyerId, "E");
                    oPanel.Visible = true;
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    m_oGridMasterView = grdViewReceipt;
                    m_oGridMasterView.FocusedRowHandle = grdViewReceipt.FocusedRowHandle;
                    m_iFocusRowId = grdViewReceipt.FocusedRowHandle;
                    //PBRegId = Convert.ToInt32(grdViewReceipt.GetRowCellValue(grdViewReceipt.FocusedRowHandle,"ReceiptId"));
                    CommFun.DW1.Hide();
                    //frmReceiptEntry frmCompEntry = new frmReceiptEntry();
                    CommFun.DW2.Text      = "PMS 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(BuyerId, "E");
                    CommFun.DW2.Show();
                }
            }
        }