Exemplo n.º 1
0
        private void VYear_Leave(object sender, EventArgs e)
        {
            if (VYear.Text.ToString().Equals(""))
            {
                Err.SetError(VYear, "Fill the Year  of the movie ");
            }
            else
            {
                Err.Clear();

                try
                {
                    //dislay the cost of the price of the video after adding the year of the video
                    DateTime dateNow = DateTime.Now;

                    int Currentyear = dateNow.Year;

                    int diffYear = Currentyear - Convert.ToInt32(VYear.Text.ToString());
                    // MessageBox.Show(diff.ToString());
                    if (diffYear >= 5)
                    {
                        Vcost.Text = "2";
                    }
                    if (diffYear >= 0 && diffYear < 5)
                    {
                        Vcost.Text = "5";
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }
Exemplo n.º 2
0
 private void txtReplace_Validating(object sender, CancelEventArgs e)
 {
     if (txtReplace.Text == "")
     {
         Err.SetError(txtReplace, txtReplace.AccessibleName);
     }
     else
     {
         Err.SetError(txtReplace, "");
     }
 }
Exemplo n.º 3
0
        //private void txtDir_Validating(object sender, CancelEventArgs e)
        //{
        //    if (txtDir.Text == "")
        //        Err.SetError(txtDir, txtDir.AccessibleName);
        //    else
        //        Err.SetError(txtDir, "");
        //}

        private void txtFind_Validating(object sender, CancelEventArgs e)
        {
            if (txtFind.Text == "")
            {
                Err.SetError(txtFind, txtFind.AccessibleName);
            }
            else
            {
                Err.SetError(txtFind, "");
            }
        }
Exemplo n.º 4
0
 private void CAddress_Leave(object sender, EventArgs e)
 {
     if (CAddress.Text.ToString().Equals(""))
     {
         Err.SetError(CAddress, "Can't Leave Blank");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 5
0
 private void VGenre_Leave(object sender, EventArgs e)
 {
     if (VGenre.Text.ToString().Equals(""))
     {
         Err.SetError(VGenre, "Fill the details of the movie");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 6
0
 private void VCopies_Leave(object sender, EventArgs e)
 {
     if (VCopies.Text.ToString().Equals(""))
     {
         Err.SetError(VCopies, "Fill the No of copies available  in the store  ");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 7
0
 private void VRatting_Leave(object sender, EventArgs e)
 {
     if (VRatting.Text.ToString().Equals(""))
     {
         Err.SetError(VRatting, "Fill the Ratting  of the movie ");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 8
0
 private void Vtitle_Leave(object sender, EventArgs e)
 {
     if (Vtitle.Text.ToString().Equals(""))
     {
         Err.SetError(Vtitle, "Fill the title of the movie ");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 9
0
 private void MoviePK_Leave(object sender, EventArgs e)
 {
     if (MoviePK.Text.ToString().Equals(""))
     {
         Err.SetError(MoviePK, "fetch the id of the Movie ");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 10
0
 private void CustomerPK_Leave(object sender, EventArgs e)
 {
     if (CustomerPK.Text.ToString().Equals(""))
     {
         Err.SetError(CustomerPK, "fetch the id of the Customer ");
     }
     else
     {
         Err.Clear();
     }
 }
Exemplo n.º 11
0
        private bool TestValidating()
        {
            bool res = true;

            if (txtDir.Text == "")
            {
                Err.SetError(txtDir, txtDir.AccessibleName);
                res = false;
            }
            else
            {
                Err.SetError(txtDir, "");
            }

            if (txtFind.Text == "")
            {
                Err.SetError(txtFind, txtFind.AccessibleName);
                res = false;
            }
            else
            {
                Err.SetError(txtFind, "");
            }

            if (txtReplace.Text == "")
            {
                Err.SetError(txtReplace, txtReplace.AccessibleName);
                res = false;
            }
            else
            {
                Err.SetError(txtReplace, "");
            }

            return(res);
        }