protected void Page_Load(object sender, System.EventArgs e)
        {
            // �b�o�̩�m�ϥΪ̵{���X�H��l�ƺ��

                if(Request.Params["ContentID"]!=null && Request.Params["MovieName"]!=null && Request.Params["ParentID"]!=null)
                {
                    MovieName = Request.Params["MovieName"].ToString();
                    ContentID = Request.Params["ContentID"].ToString();
                    ParentID = Request.Params["ParentID"].ToString();

                    if(Request.Params["UserSN"]!=null)//user had entered the ID --> to open db to check
                    {
                        myAPI myAPI = null;

                        if(Session["DBName"]==null) Response.Redirect ("LogOn.aspx");
                        myAPI =new myAPI(Session["DBName"].ToString() );

                        if(myAPI.Check_User(Request.Params["UserSN"].ToString().Trim()))
                        {
                            //20090813 clay����
                            //myAPI.Update_View_Content_Log(Request.Params["UserSN"].ToString(), ContentID, Request.UserHostAddress.ToString(),Session.SessionID);
                            LoginStatus = "1";//logon
                        }
                        else
                        {
                            LoginStatus = "0";//login failed
                        }
                    }

                }
                else
                    Response.Redirect("main.aspx");
        }
        protected void btnLogOn_Click(object sender, System.EventArgs e)
        {
            if (this.IsValid==true)
            {
                string userUserID=txtUserID.Text;
                string userPwd=txtUserPwd.Text;
                string userGroup=se.SelectedItem.Value;
                Session["userGroup"]=userGroup;

                //myAPI myAPI = new myAPI("Smart-iTV_V2_5");
                myAPI myAPI = new myAPI("ndapn");

                if ( userUserID != null)
                {
                 	DataTable dt0 = myAPI.GetUserPD(userUserID);
                    if(dt0.Rows.Count==0)
                    {
                        ShowMsg("�L���b��");
                        se.Items.Clear();
                        se_GetPortalMapping();
                        return;
                    }
                    if (userPwd == dt0.Rows[0].ItemArray.GetValue(0).ToString() )
                    {

                        if ( dt0.Rows[0].ItemArray.GetValue(1).ToString() == userGroup)
                        {
                               Response.Cookies["UserID"].Value = userUserID;
                               Session["DBName"] = dt0.Rows[0].ItemArray.GetValue(2).ToString();
                               Session["User_Name_"]=userUserID;
                               Session["User_IP_"]=Request.ServerVariables["REMOTE_ADDR"];

                               myAPI API2 = new myAPI(Session["DBName"].ToString());

                               Response.Redirect ("default.aspx");
                        }
                        else
                        {
                            ShowMsg("�v�����~");
                            se.Items.Clear();
                            se_GetPortalMapping();
                        }

                    }
                    else
                    {
                        ShowMsg("�K�X���~�A���s��J");
                        se.Items.Clear();
                        se_GetPortalMapping();
                    }
                }
                else
                {
                    ShowMsg("�b�����~�A���s��J");
                    se.Items.Clear();
                    se_GetPortalMapping();
                }
            }
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if(Session["DBName"]==null) Response.Redirect ("LogOn.aspx");
            Session["DBName"]="ndapn";
            myAPI =new myAPI(Session["DBName"].ToString() );

            #region �s������

            #endregion
        }
Exemple #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Session["DBName"] = "ndapn";
            myAPI =new myAPI(Session["DBName"].ToString() );

            if(Request.Params["LoginStatus"]!=null)
                LoginStatus = Request.Params["LoginStatus"].ToString();

            if(Request.Params["ParentID"]==null)
                Response.Redirect("./main.aspx");
            else
                ParentID = Request.Params["ParentID"].ToString();
        }
Exemple #5
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     //Session["DBName"]="Smart_iTV_V2_6";
                 Session["DBName"]="ndapn";
     myAPI =new myAPI(Session["DBName"].ToString() );
 }
        private void se_GetPortalMapping()
        {
            //myAPI myAPI = new myAPI("Smart-iTV_V2_5");
            myAPI myAPI = new myAPI("ndapn");

            string[] PortalMapping;
            string[] PortalName;
            PortalMapping = myAPI.GetPortalMapping().Split(',');
            PortalName = myAPI.GetPortalName().Split(',');
            for(int i=PortalMapping.GetLowerBound(0);i <= PortalMapping.GetUpperBound(0);i++)
            {
                if(PortalMapping[i]!="")
                {
                    se.Items.Insert(0,new ListItem(PortalMapping[i],PortalName[i]));
                }
            }
        }