/// <summary>
        /// Delete a view by it's name
        /// </summary>
        public void DeleteState(String stateName)
        {
            Trace.WriteLine(String.Format("Deleting row {0} from states table", stateName));
            CheckViewTableRow(stateName);
            BtnDelete.Click();
            var alert = Web.PortalDriver.SwitchTo().Alert();

            alert.Accept();
            Wait.Until(d => !new Link(By.LinkText(stateName)).Exists);
        }
        public void DeleteSection(String sectionName)
        {
            var checkbox = new Checkbox(By.XPath("//a[text()='" + sectionName + "']/../../td[1]/input[@type='checkbox']"));

            checkbox.Checked = true;
            BtnDelete.Click();
            var alert = Web.PortalDriver.SwitchTo().Alert();

            alert.Accept();
            Wait.Until(d => !new Link(By.LinkText(sectionName)).Exists);
        }
Ejemplo n.º 3
0
        public void Delete(int rowIndex = -1, bool getLastRow = false)
        {
            var row = GetRow(getLastRow: true);

            row.ChkBox.Click();
            BtnDelete.Click();
            var alert = Web.PortalDriver.SwitchTo().Alert();

            alert.Accept();
            ClickPortalUI.Wait.Until(d => new Container(By.XPath("//td[contains(@class, 'SuccessArea')]")).Exists);
        }
Ejemplo n.º 4
0
        public EditLibrariansForm()
        {
            InitializeComponent();

            _librarianService = new LibrarianService();

            BtnDelete.Hide();
            BtnUpdate.Hide();

            FillMembersDgv();
        }
        public void DeleteStep(String name)
        {
            var chkStep = new Checkbox(
                By.XPath("(//*[@id='_webrRSV_DIV_0']/table/tbody/tr/td[3]/a[text()='" + name +
                         "'])[1]/../../td[1]/input[@type='checkbox']"));

            chkStep.Checked = true;
            BtnDelete.Click();
            Web.PortalDriver.SwitchTo().Alert().Accept();
            Wait.Until(d => !new Link(By.LinkText(name)).Exists);
        }
Ejemplo n.º 6
0
        public void DeleteTemplate(String templateName)
        {
            var checkbox = new Checkbox(By.XPath("//a[text()='" + templateName + "']/../../td[1]/input[@type='checkbox']"));

            checkbox.Checked = true;
            BtnDelete.Click();
            var alert = Web.PortalDriver.SwitchTo().Alert();

            alert.Accept();
            var link = new Link(By.LinkText(templateName));

            ClickPortalUI.Wait.Until(d => !link.Exists);
        }
 //DataGridView Cell Click//
 private void DgvAddBooks_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         id    = (int)DgvAddBooks.Rows[e.RowIndex].Cells[0].Value;
         _book = _bookDal.GetById(id);
         SelectedLabel.Show();
         BtnDelete.Show();
         BtnUpdate.Show();
         SelectedName.Text = _book.Name;
     }
     catch { }
 }
Ejemplo n.º 8
0
        public void InitializeEditMode()
        {
            BringToFront();
            editMode = true;
            Show();
            TBPostNr.Show();
            TBAdresse.Text      = viewModel.ValgtBolig.Adresse;
            TBAdresse.BackColor = Color.LightGray;
            TBAdresse.ReadOnly  = true; //Adresse ændres ikke medmindre vi henter en kæmpe lastbil.

            TBAreal.Text      = viewModel.ValgtBolig.Kvm.ToString();
            TBAreal.BackColor = Color.LightGray;
            TBAreal.ReadOnly  = true; //Areal ændres ikke

            TBPris.Text      = viewModel.ValgtBolig.Pris.ToString();
            TBPris.BackColor = Color.White;

            CBPostNr.Hide(); //PostNr skal ikke ændres ever
            TBPostNr.Text     = viewModel.ValgtBolig.PostNr.ToString();
            TBPostNr.ReadOnly = true;

            LabelID.Text = viewModel.ValgtBolig.ID.ToString();

            BtnVælgE.Enabled      = false; //Kan ikke vælge EMægler i edit
            BtnVælgSælger.Enabled = false; //Kan ikke ændre sælger i edit

            BtnDelete.Enabled = true;      //Kan slette i editMode

            DTPOpretDato.Value   = viewModel.ValgtBolig.OprettelsesDato;
            DTPOpretDato.Enabled = false;                           //Kan ikke ændre dato

            TBEMæglerNavn.Text = viewModel.ValgtEmægler.ToString(); //Tostring metoden er overridet
            TBValgtSælger.Text = viewModel.ValgtSælger.ToString();  //Til at vise navn
            lblPost.Hide();
            LabelID.Show();
            LabelMode.Text = "EDIT MODE";
            BTNSolgt.Show();

            //tjekker om boligen er solgt, for så skal denne knap ikke vises!
            var erSolgt = viewModel.TjekBoligSolgt(selectedBolig);

            if (erSolgt)
            {
                BTNSolgt.Hide();
                BtnDelete.Hide();
                LabelMode.Text = "Solgt bolig";
                BtnSave.Hide();
                BtnVælgE.Hide();
                BtnVælgSælger.Hide();
            }
        }
Ejemplo n.º 9
0
        private void DgvViewAllLibrarians_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            _selectedLibrarian = _librarianService.FindId(Convert.ToInt32(DgvViewAllLibrarians.Rows[e.RowIndex].Cells[0].Value));
            _selectedRowIndex  = e.RowIndex;

            TxtLibrarianName.Text     = _selectedLibrarian.Username;
            TxtLibrarianEmail.Text    = _selectedLibrarian.Email;
            TxtLibrarianPassword.Text = _selectedLibrarian.Password;
            TxtLibrarianPhone.Text    = _selectedLibrarian.Phone;

            BtnAdd.Hide();
            BtnDelete.Show();
            BtnUpdate.Show();
        }
        public EditMembersForm()
        {
            InitializeComponent();

            _memberService = new MemberService();

            _selectedMember = new Member();

            FillMembers();

            BtnAdd.Show();
            BtnDelete.Hide();
            BtnUpdate.Hide();
        }
Ejemplo n.º 11
0
 //ManagerForm-DataGridView-Cell Click Choose Id//
 private void DgvManagerShow_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         id       = (int)DgvManagerShow.Rows[e.RowIndex].Cells[0].Value;
         _manager = _managerDal.GetById(id);
         LblSelected.Show();
         LblSelectedName.Show();
         BtnDelete.Show();
         BtnUpdate.Show();
         LblSelectedName.Text = _manager.Name + " " + _manager.Surname;
     }
     catch { }
 }
        public EditBooksForm()
        {
            InitializeComponent();

            _bookService = new BookService();

            _selectedBook = new Book();

            FillBooks();

            BtnAdd.Show();
            BtnDelete.Hide();
            BtnUpdate.Hide();
        }
        private void DgvBooks_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            _selectedBook = _bookService.Find(Convert.ToInt32(DgvBooks.Rows[e.RowIndex].Cells[0].Value));

            _selectedRowIndex = e.RowIndex;

            TxtBookName.Text      = _selectedBook.Name;
            TxtBookAuthor.Text    = _selectedBook.Author;
            TxtBookPrice.Text     = Convert.ToString(_selectedBook.Price);
            TxtBookQuantity.Text  = _selectedBook.Quantity.ToString();
            DtpPurchaseDate.Value = _selectedBook.PurchaseDate.Date;

            BtnAdd.Hide();
            BtnDelete.Show();
            BtnUpdate.Show();
        }
Ejemplo n.º 14
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
            case (Keys.Control | Keys.N):
            {
                BtnAddNew.PerformClick(); break;
            }

            case (Keys.Control | Keys.E):
            {
                BtnEdit.PerformClick(); break;
            }

            case (Keys.Control | Keys.D):
            {
                BtnDelete.PerformClick(); break;
            }

            case (Keys.Control | Keys.S):
            {
                BtnSave.PerformClick(); break;
            }

            case (Keys.Control | Keys.U):
            {
                BtnUndo.PerformClick(); break;
            }

            case (Keys.Control | Keys.F):
            {
                BtnFind.PerformClick(); break;
            }

            case (Keys.Control | Keys.R):
            {
                BtnReload.PerformClick(); break;
            }

            case (Keys.Control | Keys.P):
            {
                BtnPrint.PerformClick(); break;
            }
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
        private void DgvViewAllMembers_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            _selectedMember = _memberService.Find(Convert.ToInt32(DgvViewAllMembers.Rows[e.RowIndex].Cells[0].Value));

            _selectedRowIndex = e.RowIndex;

            TxtMemberFullname.Text = _selectedMember.Fullname;
            TxtMemberAddress.Text  = _selectedMember.Address;
            TxtMemberEmail.Text    = _selectedMember.Email;
            TxtMemberPassword.Text = _selectedMember.Password;
            TxtMemberPhone.Text    = _selectedMember.Phone;
            DtpCreatedAt.Value     = _selectedMember.CreatedAt;

            BtnAdd.Hide();
            BtnDelete.Show();
            BtnUpdate.Show();
        }
Ejemplo n.º 16
0
        private void DataGridView1_Click(object sender, EventArgs e)
        {
            selectedId          = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value.ToString());
            TxtName.Text        = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            TxtDesignation.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString();
            TxtContact.Text     = dataGridView1.CurrentRow.Cells[3].Value.ToString();
            TxtAddress.Text     = dataGridView1.CurrentRow.Cells[4].Value.ToString();

            if (teacher == "Head Teacher")
            {
                BtnUpdate.Show();
                BtnDelete.Show();
            }
            else
            {
                BtnUpdate.Hide();
                BtnDelete.Hide();
            }
        }
Ejemplo n.º 17
0
        public void InitializeCreateMode()
        {
            //generelt for create mode
            Control[] controlsToDisplay = { LblFornavn, TbFornavn, LblEfternavn, TbEfternavn };
            ShowThese(controlsToDisplay);
            BtnDelete.Hide();
            LblId.Hide();

            ClearData(); //-Martin, må gerne laves om hvis du vil

            if (ViewModel.IsSælgerMode)
            {
                LblTitel.Text  = "Opret Sælger";
                BtnAction.Text = "Opret Sælger";
            }
            else // er køber
            {
                LblTitel.Text  = "Opret Køber";
                BtnAction.Text = "Opret Køber";
            }
        }
Ejemplo n.º 18
0
        public void Nav(Form form, Panel panel)
        {
            // changing view for content panel
            form.TopLevel = false;
            form.Size     = panel.Size; // for responsive size
            panel.Controls.Clear();
            panel.Controls.Add(form);
            form.Show();

            // getting name of form that is being viewed, and assigning header title and button text from from that value
            nameOfFormOpen = form.Name;
            string currTitle = "";
            string newTitle  = "";

            // removing value "GUI" from name to be more user friendly
            if (nameOfFormOpen.Contains("GUI"))
            {
                currTitle = nameOfFormOpen.Replace("GUI", "");
                newTitle  = InsertSpaceBeforeUpperCase(currTitle);
            }
            lblNameOfFormOpen.Text = newTitle;

            ChangeButtons(newTitle.ToLower());
            if (nameOfFormOpen.Equals("DashboardGUI") || nameOfFormOpen.Equals("VenuesGUI"))
            {
                //if (nameOfFormOpen.Equals("DashboardGUI")) {
                HideButtons();
            }
            else if (nameOfFormOpen.Equals("ReservationsGUI"))
            {
                BtnCreateNew.Hide();
                BtnEdit.Hide();
                BtnDelete.Show();
            }
            else
            {
                ShowButtons();
            }
        }
Ejemplo n.º 19
0
 public void ShowButtons()
 {
     BtnCreateNew.Show();
     BtnEdit.Show();
     BtnDelete.Show();
 }
Ejemplo n.º 20
0
 public void HideButtons()
 {
     BtnCreateNew.Hide();
     BtnEdit.Hide();
     BtnDelete.Hide();
 }
Ejemplo n.º 21
0
 public void ClickBtnDelete()
 {
     BtnDelete.Click();
 }
Ejemplo n.º 22
0
        private void BtnOk_Click(object sender, EventArgs e)
        {
            if (ClsGlobal.CheckDateInsideCompanyPeriod(Convert.ToDateTime(TxtDate.Text)) == 1)
            {
                ClsGlobal.DateMitiRangeMsg();
                return;
            }

            if (string.IsNullOrEmpty(TxtVoucherNo.Text.Trim()))
            {
                MessageBox.Show("Voucher number cannot be left blank.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtVoucherNo.Focus();
                return;
            }
            if (TxtMiti.Text == "  /  /")
            {
                MessageBox.Show("Miti cannot be left blank.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtMiti.Focus();
                return;
            }

            if (TxtDate.Text == "  /  /")
            {
                MessageBox.Show("Date cannot be left blank.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDate.Focus();
                return;
            }

            if (Grid.Rows.Count <= 0)
            {
                MessageBox.Show("Invoice details not found.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Grid.Focus();
                return;
            }

            if (Grid.Rows.Count == 1 && Grid.Rows[0].Cells["Particular"].Value == null)
            {
                MessageBox.Show("Invoice details not found.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                BtnOk.Enabled = false;
                Grid.Focus();
                return;
            }

            _objPurchaseIndent.Model.EntryFromProject = "Normal";
            _objPurchaseIndent.Model.Gadget           = "Desktop";

            _objPurchaseIndent.Model.VDate       = Convert.ToDateTime(TxtDate.Text);
            _objPurchaseIndent.Model.Tag         = _Tag;
            _objPurchaseIndent.Model.VoucherNo   = TxtVoucherNo.Text.Trim();
            _objPurchaseIndent.Model.VTime       = _objDate.GetServerDateTime();
            _objPurchaseIndent.Model.VMiti       = TxtMiti.Text;
            _objPurchaseIndent.Model.RequestedBy = txtRequestedBy.Text;
            if (!string.IsNullOrEmpty(TxtDepartment.Text))
            {
                string[] dept = TxtDepartment.Tag.ToString().Split('|');
                _objPurchaseIndent.Model.DepartmentId1 = ((dept[0].ToString() == "") ? 0 : Convert.ToInt32(dept[0].ToString()));
                _objPurchaseIndent.Model.DepartmentId2 = ((dept[1].ToString() == "") ? 0 : Convert.ToInt32(dept[1].ToString()));
                _objPurchaseIndent.Model.DepartmentId3 = ((dept[2].ToString() == "") ? 0 : Convert.ToInt32(dept[2].ToString()));
                _objPurchaseIndent.Model.DepartmentId4 = ((dept[3].ToString() == "") ? 0 : Convert.ToInt32(dept[3].ToString()));
            }
            _objPurchaseIndent.Model.Remarks       = TxtRemarks.Text;
            _objPurchaseIndent.Model.BranchId      = ClsGlobal.BranchId;
            _objPurchaseIndent.Model.CompanyUnitId = ClsGlobal.CompanyUnitId;

            PurchaseIndentDetailsViewModel _PurchaseIndentDetails = null;
            int dc = Grid.Rows.Count;

            foreach (DataGridViewRow ro in Grid.Rows)
            {
                if (ro.Cells["Particular"].Value != null)
                {
                    _PurchaseIndentDetails = new PurchaseIndentDetailsViewModel
                    {
                        VoucherNo = _objPurchaseIndent.Model.VoucherNo,
                        Sno       = Grid.Rows.IndexOf(ro) + 1,
                        ProductId = Convert.ToInt32(ro.Cells["ProductId"].Value.ToString())
                    };

                    if (ro.Cells["AltQty"].Value != null)
                    {
                        decimal.TryParse(ro.Cells["AltQty"].Value.ToString().Trim(), out decimal _AltQty);
                        _PurchaseIndentDetails.AltQty = _AltQty;
                    }
                    else
                    {
                        _PurchaseIndentDetails.AltQty = 0;
                    }

                    if (ro.Cells["AltQty"].Value != null)
                    {
                        _PurchaseIndentDetails.ProductAltUnitId = !string.IsNullOrEmpty(ro.Cells["ProductAltUnitId"].Value.ToString()) ? Convert.ToInt32(ro.Cells["ProductAltUnitId"].Value.ToString()) : 0;
                    }

                    _PurchaseIndentDetails.Qty = ro.Cells["Qty"].Value != null?Convert.ToDecimal(ro.Cells["Qty"].Value.ToString().Trim()) : 0;

                    if (ro.Cells["ProductUnitId"].Value != null)
                    {
                        _PurchaseIndentDetails.ProductUnitId = string.IsNullOrEmpty(ro.Cells["ProductUnitId"].Value.ToString()) ? 0 : Convert.ToInt32(ro.Cells["ProductUnitId"].Value.ToString());
                    }
                    else
                    {
                        _PurchaseIndentDetails.ProductUnitId = 0;
                    }

                    _PurchaseIndentDetails.ConversionRatio = ro.Cells["QtyConversion"].Value != null?Convert.ToDecimal(ro.Cells["QtyConversion"].Value.ToString().Trim()) : 0;

                    _PurchaseIndentDetails.Narration = ro.Cells["Narration"].Value.ToString();

                    _objPurchaseIndent.ModelDetails.Add(_PurchaseIndentDetails);
                }
            }

            _objPurchaseIndent.Model.DocId = Convert.ToInt32(TxtVoucherNo.Tag.ToString());
            string output = "";

            if (_Tag == "DELETE")
            {
                DialogResult dialogResult = MessageBox.Show("Are you sure want to Delete Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dialogResult == DialogResult.No)
                {
                    return;
                }
            }

            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    DialogResult dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        output = _objPurchaseIndent.SavePurchaseIndent();
                    }
                }
                else
                {
                    output = _objPurchaseIndent.SavePurchaseIndent();
                }
            }
            else
            {
                output = _objPurchaseIndent.SavePurchaseIndent();
            }

            if (string.IsNullOrEmpty(output))
            {
                MessageBox.Show("Error occurred during data submission.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (_Tag == "NEW")
                {
                    MessageBox.Show("Voucher number : " + TxtVoucherNo.Text + " has been generated.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (_Tag == "EDIT")
                {
                    MessageBox.Show("Voucher number : " + TxtVoucherNo.Text + " has been updated.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else if (_Tag == "DELETE")
                {
                    MessageBox.Show("Voucher number : " + TxtVoucherNo.Text + " has been deleted.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                ClearFld();
                if (this._Tag == "NEW")
                {
                    _DocId         = Convert.ToInt32(TxtVoucherNo.Tag.ToString());
                    BtnNew.Enabled = true;
                    BtnNew.PerformClick();
                }
                else if (this._Tag == "EDIT")
                {
                    BtnEdit.Enabled = true;
                    BtnEdit.PerformClick();
                }
                else if (this._Tag == "DELETE")
                {
                    BtnDelete.Enabled = true;
                    BtnDelete.PerformClick();
                }
            }
        }
Ejemplo n.º 23
0
        void ReleaseDesignerOutlets()
        {
            if (AmountDoneBar != null)
            {
                AmountDoneBar.Dispose();
                AmountDoneBar = null;
            }

            if (AmountDoneBtn != null)
            {
                AmountDoneBtn.Dispose();
                AmountDoneBtn = null;
            }

            if (BtnCancel != null)
            {
                BtnCancel.Dispose();
                BtnCancel = null;
            }

            if (BtnClose != null)
            {
                BtnClose.Dispose();
                BtnClose = null;
            }

            if (BtnDelete != null)
            {
                BtnDelete.Dispose();
                BtnDelete = null;
            }

            if (BtnOk != null)
            {
                BtnOk.Dispose();
                BtnOk = null;
            }

            if (BtnRevenueDone != null)
            {
                BtnRevenueDone.Dispose();
                BtnRevenueDone = null;
            }

            if (BtnTaxDone != null)
            {
                BtnTaxDone.Dispose();
                BtnTaxDone = null;
            }

            if (LblAmount != null)
            {
                LblAmount.Dispose();
                LblAmount = null;
            }

            if (LblDescription != null)
            {
                LblDescription.Dispose();
                LblDescription = null;
            }

            if (LblRevenue != null)
            {
                LblRevenue.Dispose();
                LblRevenue = null;
            }

            if (LblTaxType != null)
            {
                LblTaxType.Dispose();
                LblTaxType = null;
            }

            if (LblTitle != null)
            {
                LblTitle.Dispose();
                LblTitle = null;
            }

            if (LblVat != null)
            {
                LblVat.Dispose();
                LblVat = null;
            }

            if (RevenueDoneBar != null)
            {
                RevenueDoneBar.Dispose();
                RevenueDoneBar = null;
            }

            if (RevenuePicker != null)
            {
                RevenuePicker.Dispose();
                RevenuePicker = null;
            }

            if (ScrollVw != null)
            {
                ScrollVw.Dispose();
                ScrollVw = null;
            }

            if (TaxtTypePicker != null)
            {
                TaxtTypePicker.Dispose();
                TaxtTypePicker = null;
            }

            if (TaxTypeDoneBar != null)
            {
                TaxTypeDoneBar.Dispose();
                TaxTypeDoneBar = null;
            }

            if (TxtAmount != null)
            {
                TxtAmount.Dispose();
                TxtAmount = null;
            }

            if (TxtDescription != null)
            {
                TxtDescription.Dispose();
                TxtDescription = null;
            }

            if (TxtRevenue != null)
            {
                TxtRevenue.Dispose();
                TxtRevenue = null;
            }

            if (TxtTaxType != null)
            {
                TxtTaxType.Dispose();
                TxtTaxType = null;
            }

            if (TxtVat != null)
            {
                TxtVat.Dispose();
                TxtVat = null;
            }
        }