Ejemplo n.º 1
0
        private void timAutoStart_Tick(object sender, EventArgs e)
        {
            lblCurrentTime.Text = Convert.ToString(Convert.ToInt32(lblCurrentTime.Text) - 1);
            if (lblCurrentTime.Text == "0")
            {
                timAutoStart.Enabled = false;
                string strOpt = "";

                if (ObjMainClass.CheckForInternetConnection() == true)
                {
                    CheckPlayerUpdateVersion();
                    SubmitValidation();
                    if (SubmitValidate == "True")
                    {
                        //strOpt = "select * from users where userid=" + StaticClass.TokenUserId;
                        //DataSet dsOption = new DataSet();
                        //dsOption = ObjMainClass.fnFillDataSet(strOpt);
                        //StaticClass.MainwindowMessage = StaticClass.MainwindowMessage + " (" + dsOption.Tables[0].Rows[0]["Useremail"].ToString() + ")";


                        strOpt = "";
                        strOpt = "select * from tbAdvertisementTiming";
                        DataSet dsOption1 = new DataSet();
                        dsOption1            = ObjMainClass.fnFillDataSet(strOpt);
                        StaticClass.AdvtTime = Convert.ToInt32(dsOption1.Tables[0].Rows[0]["AdvtTime"]);
                    }
                }
                else
                {
                    DataTable dtPlaylist    = new DataTable();
                    DataTable dtSong        = new DataTable();
                    string    LocalSongFind = "No";
                    string    str           = "select * from Playlists where tokenid= " + StaticClass.TokenId;
                    dtPlaylist = ObjMainClass.fnFillDataTable_Local(str);
                    if ((dtPlaylist.Rows.Count == 0))
                    {
                        lblError.Visible     = true;
                        lblCurrentTime.Text  = "10";
                        timAutoStart.Enabled = true;
                        return;
                    }
                    for (int iCtr = 0; (iCtr <= (dtPlaylist.Rows.Count - 1)); iCtr++)
                    {
                        string stSong = "select * from TitlesInPlaylists where PlaylistID= " + dtPlaylist.Rows[iCtr]["playlistId"];
                        dtSong = ObjMainClass.fnFillDataTable_Local(stSong);
                        if ((dtSong.Rows.Count > 0))
                        {
                            LocalSongFind = "Yes";
                            break;
                        }
                    }
                    if (LocalSongFind == "No")
                    {
                        lblError.Visible     = true;
                        lblCurrentTime.Text  = "10";
                        timAutoStart.Enabled = true;
                        return;
                    }
                }

                CopyrightPlayer objMainWindow = new CopyrightPlayer();

                objMainWindow.Show();
                this.Hide();
            }
        }
Ejemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string strOpt = "";


            timAutoStart.Enabled = false;

            if (ObjMainClass.CheckForInternetConnection() == true)
            {
                CheckPlayerUpdateVersion();
                SubmitValidation();
                if (SubmitValidate == "True")
                {
                    //strOpt = "select * from users where userid=" + StaticClass.TokenUserId;
                    //DataSet dsOption = new DataSet();
                    //dsOption = ObjMainClass.fnFillDataSet(strOpt);
                    //StaticClass.MainwindowMessage = StaticClass.MainwindowMessage + " (" + dsOption.Tables[0].Rows[0]["Useremail"].ToString() + ")";


                    strOpt = "";
                    strOpt = "select * from tbAdvertisementTiming";
                    DataSet dsOption1 = new DataSet();
                    dsOption1            = ObjMainClass.fnFillDataSet(strOpt);
                    StaticClass.AdvtTime = Convert.ToInt32(dsOption1.Tables[0].Rows[0]["AdvtTime"]);

                    //if (chkRemember.Checked == true)
                    //{
                    //    Properties.Settings.Default.RememberMeUsername = txtloginUserName.Text;
                    //    Properties.Settings.Default.RememberMePassword = txtLoginPassword.Text;
                    //    Properties.Settings.Default.Save();
                    //}
                    //else
                    //{
                    //    Properties.Settings.Default.RememberMeUsername = "";
                    //    Properties.Settings.Default.RememberMePassword = "";
                    //    Properties.Settings.Default.Save();
                    //}
                }

                else
                {
                    DataTable dtPlaylist    = new DataTable();
                    DataTable dtSong        = new DataTable();
                    string    LocalSongFind = "No";
                    string    str           = "select * from Playlists where tokenid= " + StaticClass.TokenId;
                    dtPlaylist = ObjMainClass.fnFillDataTable_Local(str);
                    if ((dtPlaylist.Rows.Count == 0))
                    {
                        MessageBox.Show("Local are songs not found.Please connect your internet to download the songs");
                        return;
                    }
                    for (int iCtr = 0; (iCtr <= (dtPlaylist.Rows.Count - 1)); iCtr++)
                    {
                        string stSong = "select * from TitlesInPlaylists where PlaylistID= " + dtPlaylist.Rows[iCtr]["playlistId"];
                        dtSong = ObjMainClass.fnFillDataTable_Local(stSong);
                        if ((dtSong.Rows.Count > 0))
                        {
                            LocalSongFind = "Yes";
                            break;
                        }
                    }
                    if (LocalSongFind == "No")
                    {
                        MessageBox.Show("Local are songs not found.Please connect your internet to download the songs");
                        return;
                    }
                }
                CopyrightPlayer objMainWindow = new CopyrightPlayer();
                objMainWindow.Show();
                this.Hide();
            }
        }