Пример #1
0
        public void ShowDriverRent(int Id)
        {
            frmDriverRentDebitCredit3 frm = new frmDriverRentDebitCredit3();

            frm.OnDisplayRecord(Id);


            DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmfrmDriverRentDebitCredit31");

            if (doc != null)
            {
                doc.Close();
            }

            MainMenuForm.MainMenuFrm.ShowForm(frm);
        }
Пример #2
0
        void AddRentItems1_Click(object sender, EventArgs e)
        {
            try
            {
                if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
                {
                    int id = grdLister.CurrentRow.Cells["Id"].Value.ToInt();
                    //if (AppVars.listUserRights.Count(c => c.formName == "frmDriverRent") > 0)
                    //{
                    //    frmDriverRent frm = new frmDriverRent(id);

                    //    DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverRent1");

                    //    if (doc != null)
                    //    {
                    //        doc.Close();
                    //    }

                    //    MainMenuForm.MainMenuFrm.ShowForm(frm);

                    //}
                    //else
                    //{
                    if (AppVars.listUserRights.Count(c => c.formName == "frmDriverRentDebitCredit3") > 0)
                    {
                        frmDriverRentDebitCredit3 frm = new frmDriverRentDebitCredit3(id);

                        DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverRentDebitCredit21");

                        if (doc != null)
                        {
                            doc.Close();
                        }

                        MainMenuForm.MainMenuFrm.ShowForm(frm);
                    }
                }
                //}
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Пример #3
0
        void AddCommisionItems3_Click(object sender, EventArgs e)
        {
            try
            {
                if (grdLister.CurrentRow != null && grdLister.CurrentRow is GridViewDataRowInfo)
                {
                    int  id          = grdLister.CurrentRow.Cells["Id"].Value.ToInt();
                    long?lastTransId = 0;
                    using (TaxiDataContext db = new TaxiDataContext())
                    {
                        lastTransId = db.DriverRents.Where(c => c.DriverId == id).Select(c => c.Id).OrderByDescending(c => c).FirstOrDefault();
                    }

                    if (lastTransId.ToLong() == 0)
                    {
                        MessageBox.Show("no record found");
                    }
                    else
                    {
                        frmDriverRentDebitCredit3 frm = new frmDriverRentDebitCredit3();
                        frm.OnDisplayRecord(lastTransId);


                        DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverRentDebitCredit31");

                        if (doc != null)
                        {
                            doc.Close();
                        }

                        MainMenuForm.MainMenuFrm.ShowForm(frm);
                    }
                }
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
        void ShowForm(long id)
        {
            //if (AppVars.listUserRights.Count(c => c.formName == "frmDriverRent") > 0)
            //{
            //    frmDriverRent frm = new frmDriverRent();
            //    frm.OnDisplayRecord(id);


            //    DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverRent1");

            //    if (doc != null)
            //    {
            //        doc.Close();
            //    }

            //    MainMenuForm.MainMenuFrm.ShowForm(frm);
            //}
            //else
            //{
            //frmDriverRentDebitCredit
            if (AppVars.listUserRights.Count(c => c.formName == "frmDriverRentDebitCredit3") > 0)
            {
                frmDriverRentDebitCredit3 frm = new frmDriverRentDebitCredit3();
                frm.OnDisplayRecord(id);


                DockWindow doc = UI.MainMenuForm.MainMenuFrm.GetDockByName("frmDriverRentDebitCredit31");

                if (doc != null)
                {
                    doc.Close();
                }

                MainMenuForm.MainMenuFrm.ShowForm(frm);
            }
            //}
        }