Exemplo n.º 1
0
        /// <summary>
        ///check if every info is put or not
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public int SaveRegistrationInfo(params string[] list)
        {
            try
            {
                if (list[0] == "")
                {
                    MessageBox.Show("Put your first name");
                    return(-1);
                }
                else if (list[1] == "")
                {
                    MessageBox.Show("Put your Sur name");
                    return(-1);
                }
                else if ((list[2] == "") || (list[2].Contains("@") == false) || (list[2].Contains(".") == false))
                {
                    MessageBox.Show("Put your Email");

                    return(-1);
                }
                else if ((list[3] == "") || (list[3].All(char.IsDigit) == false) || list[3].Length < 11 || list[3].Length > 11)
                {
                    MessageBox.Show("Put your Mobile");
                    return(-1);
                }
                else if ((list[4] == "") || (list[4].Any(char.IsDigit) == false) || (list[4].Any(char.IsLetter) == false) || list[4].Length < 8)
                {
                    MessageBox.Show("Put your password");
                    return(-1);
                }
                else
                {
                    return
                        (dw.SaveRegistrationInfo_2(list));
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return(0);
            }
        }