Exemplo n.º 1
0
    protected void Click_Click(object sender, EventArgs e)
    {
        pyatLevelLogic plLogic = new pyatLevelLogic();
        //string m_strRemotingServer = "localhost";
        //string m_intRemotingPort = "7777";
        //string strURL = String.Format("tcp://{0}:{1}/pyatLevelLogic", m_strRemotingServer, m_intRemotingPort);
        //pyatLevelLogic plLogic = new pyatLevelLogic();
        //plLogic = (pyatLevelLogic)Activator.GetObject(typeof(pyatLevelLogic), strURL);
           try
        {
            int res;
           //  res = plLogic.GetDataByUserNamenPassword(usernamefield.Text, passwordfield.Text);
            res = plLogic.LogIn(usernamefield.Text, passwordfield.Text, EmailIDField.Text);
            //TODO : store session info.
           // if (res == 0)
            //    loginResult.Text = "Invalid UserName or Password";
            //TODO: Logic to redirect only on valid session.

            if (res > 0)
            {
                Session.Add("userid", res);
                Response.Redirect("HomePage.aspx");

            }
        }
        catch
        {
        }
    }
 protected override void OnStart(string[] args)
 {
     // TODO: Add code here to start your service.
     EventLog myevent = new EventLog();
     myevent.Source = " pyatlevelBLLService";
     myevent.WriteEntry(" pyatlevelBLLService has started");
     TcpChannel mychannel = new TcpChannel(7777);
     ChannelServices.RegisterChannel(mychannel, false);
     pyatLevelLogic mypyatLevelLogicLayer = new pyatLevelLogic();
     // Register the Proxy class for remoting.
     RemotingConfiguration.RegisterWellKnownServiceType(
                                 typeof(pyatLevelLogic),
                                 "pyatLevelLogic",
                                  WellKnownObjectMode.Singleton);
 }
    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {
        pyatLevelLogicLayer.pyatLevelLogic blObj = new pyatLevelLogic();
        try
        {

            int success = blObj.addNewUser(CreateUserWizard.UserName, CreateUserWizard.Password, CreateUserWizard.Email, CreateUserWizard.Question, CreateUserWizard.Answer);
            if (success > 0)
            {
                //user information was inserted successfully.
                //I guess more to be done when user info is inserted fully.
                //then a mail is sent to Brian. He confirms if one needs to be logging in.
              //  string approverEmailID = "*****@*****.**";
                sendMailToApprove(CreateUserWizard.UserName, CreateUserWizard.Email, approverEmailID);
            }
        }
        catch
        {
        }
    }