Exemple #1
0
        /*Check existing users authentication*/
        void auth_btn_submit_Click(object sender, RoutedEventArgs e)
        {
            DemoServiceClient webservice = new DemoServiceClient();

            mybuttton = sender as Button;

            Database_fireworks_.ServiceReference1.DemoServiceClient webService = new DemoServiceClient();

            webService.GetRowsCompleted += new EventHandler <GetRowsCompletedEventArgs>(webService_GetRowsCompleted);

            webService.GetRowsAsync();
        }
Exemple #2
0
        void sup_tbox_duname_LostFocus(object sender, RoutedEventArgs e)
        {
            flag = 1;
            sup_tblock_tip.Visibility = Visibility.Collapsed;
            img_duname.Visibility     = Visibility.Collapsed;
            SolidColorBrush mybrush = new SolidColorBrush();

            if (sup_tbox_duname.Text.Length > 12)//check for desired user name whether exceeding 12 characters
            {
                System.Windows.Browser.HtmlPage.Window.Alert("Maximum limit for desird user name crossed.Maximum limit is 12 characters.");
                img_duname.Visibility = System.Windows.Visibility.Visible;
                //sup_tblock_duname.Foreground = mybrush;
                sup_tblock_duname.Foreground = new SolidColorBrush(Colors.Red);
                flag = 0;
            }

            if (sup_tbox_duname.Text != "")//check for desired user name whether it is blank or not and if not blank then enter
            {
                char[] sup_chk_duname = new char[12];
                int    flag1          = 0;//variable for checking error in user name

                sup_chk_duname = sup_tbox_duname.Text.ToCharArray();

                /*Check whether first character of user name is not a number or special character*/
                if (!((sup_chk_duname[0] >= 'a' && sup_chk_duname[0] <= 'z') || (sup_chk_duname[0] >= 'A' && sup_chk_duname[0] <= 'Z')))
                {
                    System.Windows.Browser.HtmlPage.Window.Alert("User name should start with character.");
                    img_duname.Visibility = Visibility.Visible;
                    flag1 = 1;//error
                }

                if (flag1 == 0)//call for checking availability of user name if there exist no error
                {
                    DemoServiceClient webService = new DemoServiceClient();

                    webService.GetRowsCompleted += new EventHandler <GetRowsCompletedEventArgs>(webService_GetRowsCompleted);

                    webService.GetRowsAsync();
                }
            }
        }