Beispiel #1
0
        public void InstanceMemberNamedInvokeShouldQualifyAsAppWithRun()
        {
            var theSite = new MySite();

            var builder = new AppBuilder();

            var theApp = builder.BuildNew <Func <int, string> >(x => x.Run(theSite));

            theApp(42).ShouldBe("Called[42]");
        }
Beispiel #2
0
        protected void UpdatePwd_Click(object sender, EventArgs e)
        {
            string sql = String.Empty;

            // --> 암호를 입력하세요.
            if (txtPWD.Text.Trim() == "")
            {
                lblmsg.Text = "암호를 입력하세요";
                txtPWD.Focus();
                return;
            }
            if (txtPWD2.Text.Trim() == "")
            {
                lblmsg.Text = "암호를 입력하세요";
                txtPWD2.Focus();
                return;
            }

            if (txtPWD.Text != txtPWD2.Text)
            {
                lblmsg.Text = "암호가 일치하지 않습니다.";
                return;
            }

            if (txtPWD.Text.Trim() != "" && txtPWD2.Text.Trim() != "")
            {
                sql = "update member set m_pwd=@m_pwd where m_id='" + txtID.Text + "'";
            }
            string       pwd  = MySite.MD5Hash(txtPWD.Text);
            DBConn       conn = new DBConn();
            OleDbCommand cmd  = new OleDbCommand(sql, conn.GetConn());

            cmd.Parameters.Add("@m_pwd", pwd);

            try
            {
                cmd.ExecuteNonQuery();
                Response.Write("<script>alert('재설정 완료.');</script>");
            }
            catch (Exception ee)//버튼 이벤트 변수가 e
            {
                Response.Write("<script>alert('재설정 실패.');</script>");
            }
            finally
            {
                conn.Close();
            }
        }
Beispiel #3
0
    protected void SendPasword(object sender, EventArgs e)
    {
        Page.Validate("SendPassword");

        if (Page.IsValid)
        {
            try
            {
                //-- Enviar Contraseña
                //------------------------------
                string email   = ((TextBox)Login1.FindControl("txtEmail")).Text;
                string usuario = Membership.GetUserNameByEmail(email);
                if (string.IsNullOrEmpty(usuario))
                {
                    ((Literal)Login1.FindControl("ltrMessage")).Text = "<span style='color:red;font-size:10px;'>El email ingresado no pertenece a un Usuario Registrado. <br />Por favor, ingrese un email válido!</span>";
                }
                else
                {
                    //-- LEVANTO EL TEMPLATE
                    //-----------------------------------------------
                    StringBuilder sbTemplate = new StringBuilder(MySite_EMail.GetTemplate("~/Templates/Emails", "RecuperarClave.htm"));
                    if (!string.IsNullOrEmpty(sbTemplate.ToString()))
                    {
                        MembershipUser oUser    = Membership.GetUser(usuario);
                        String         password = oUser.GetPassword();

                        sbTemplate.Replace("{{Usuario}}", usuario);
                        sbTemplate.Replace("{{Contraseña}}", password);
                        sbTemplate.Replace("{{FullSiteName}}", MySite.GetFullSiteName_FromAppConfig());

                        MySite_EMail.Send(email,
                                          null,
                                          "Interfood - Recupero de Contraseña",
                                          sbTemplate.ToString(),
                                          true,
                                          System.Net.Mail.MailPriority.Normal);

                        ((Literal)Login1.FindControl("ltrMessage")).Text = "<span style='color:green;font-size:10px;'>Se han enviado correctamente sus datos privados! <br />Por favor verifique su Correo Electrónico.</span>";
                    }
                }
            }
            catch (Exception ex)
            {
                ((Literal)Login1.FindControl("ltrMessage")).Text = "<span style='color:red;font-size:10px;'>Oooops, ocurrió un error al enviar el Email. <br />Por favor inténtelo mas tarde.</span>";
                Logger.LogExceptionStatic(ex);
            }
        }
    }
Beispiel #4
0
        static void Main(string[] args)
        {
            MySite mySite = new MySite();

            mySite.Main();
            //SuperObject user = new SuperObject();
            //user.SetUsername("Lesha");
            //user.SetPassword("123");

            //SuperObject user2 = new SuperObject();
            //user2.SetUsername("Misha");
            //user2.SetPassword("1234");

            //user2.AddToFriend(user);

            //user2.ShowFriends();

            Console.ReadKey();
        }
        public void InstanceMemberNamedInvokeShouldQualifyAsAppWithRun()
        {
            var theSite = new MySite();

            var builder = new AppBuilder();

            var theApp = builder.BuildNew<Func<int, string>>(x => x.Run(theSite));

            theApp(42).ShouldBe("Called[42]");
        }
Beispiel #6
0
        protected void btnSave_Click(object sender, ImageClickEventArgs e)
        {
            string sql = String.Empty;

            // --> 암호를 입력하세요.
            if (txtPWD.Text.Trim() == "")
            {
                msg.Text = "암호를 입력하세요";
                txtPWD.Focus();
                return;
            }
            if (txtPWD2.Text.Trim() == "")
            {
                msg.Text = "암호를 입력하세요";
                txtPWD2.Focus();
                return;
            }

            if (txtPWD.Text != txtPWD2.Text)
            {
                msg.Text = "암호가 서로 다릅니다";
                return;
            }
            // --> E-mail을  입력하세요.
            if (txtEmail.Text.Trim() == "")
            {
                msg.Text = "이메일을 입력하세요";
                txtEmail.Focus();
                return;
            }
            //이메일 형식
            if (txtEmail.Text != null)
            {
                Regex regex = new Regex("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$");
                Match m     = regex.Match(txtEmail.Text);
                if (m.Success)
                {
                    msg.Text = "이메일 통과";
                }

                else
                {
                    msg.Text = "이메일 형식으로 입력하세요";
                    txtEmail.Focus();
                    return;
                }
            }


            if (txtPhone.Text.Trim() == "")
            {
                msg.Text = "전화번호를 입력하세요";
                txtPhone.Focus();
                return;
            }

            //전화번호 정규식

            if (txtPhone.Text.Trim() != null)
            {
                Regex regex = new Regex(@"01[016789]{1}-[0-9]{3,4}-[0-9]{4}");
                Match m     = regex.Match(txtPhone.Text);
                if (m.Success)
                {
                }

                else
                {
                    msg.Text = "전화번호 형식으로 입력하세요";
                    txtPhone.Focus();
                    return;
                }
            }


            if (txtPWD.Text.Trim() != "" && txtPWD2.Text.Trim() != "")
            {
                sql = "update member set m_pwd=@m_pwd, m_email = @m_email,m_phone = @m_phone where m_id='" + txtID.Text + "'";
            }
            string       pwd  = MySite.MD5Hash(txtPWD.Text);
            DBConn       conn = new DBConn();
            OleDbCommand cmd  = new OleDbCommand(sql, conn.GetConn());

            cmd.Parameters.Add("@m_pwd", pwd);
            cmd.Parameters.Add("@m_email", txtEmail.Text);
            cmd.Parameters.Add("@m_phone", txtPhone.Text);



            try
            {
                cmd.ExecuteNonQuery();
                Response.Write("<script>alert('정보 수정 완료.');</script>");
            }
            catch (Exception ee)//버튼 이벤트 변수가 e
            {
                Response.Write("<script>alert('정보 수정 실패.');</script>");
            }
            finally
            {
                conn.Close();
            }
        }
Beispiel #7
0
 private void FillFields()
 {
     _databaseMethods.InsertLoginedFrom(Constants.from_card_creating_premium);
     //var timer = new System.Timers.Timer();
     //timer.Interval = 50;
     try
     {
         //if (SocialNetworkTableViewSource<int, int>._checkedRows != null)
         //{
         //    if (SocialNetworkTableViewSource<int, int>.selectedIndexes.Count != 0)
         //    {
         //        social_netw_mainBn.SetBackgroundImage(null, UIControlState.Normal);
         //        social_netw_mainBn.SetTitleColor(UIColor.White, UIControlState.Normal);
         //    }
         //    else
         //    {
         //        social_netw_mainBn.SetBackgroundImage(null, UIControlState.Normal);
         //        //social_netw_mainBn.SetBackgroundImage(UIImage.FromBundle("button_inactive.png"), UIControlState.Normal);
         //        social_netw_mainBn.SetTitleColor(UIColor.FromRGB(146, 150, 155), UIControlState.Normal);
         //    }
         //}
         //else
         //{
         //    social_netw_mainBn.SetBackgroundImage(null, UIControlState.Normal);
         //    //social_netw_mainBn.SetBackgroundImage(UIImage.FromBundle("button_inactive.png"), UIControlState.Normal);
         //    social_netw_mainBn.SetTitleColor(UIColor.FromRGB(146, 150, 155)/*FromRGB(75, 75, 75)*/, UIControlState.Normal);
         //}
     }
     catch { }
     if (
         String.IsNullOrEmpty(HomeAddressActivity.FullAddressStatic) &&
         String.IsNullOrEmpty(HomeAddressActivity.MyCountry) &&
         String.IsNullOrEmpty(HomeAddressActivity.MyRegion) &&
         String.IsNullOrEmpty(HomeAddressActivity.MyCity) &&
         String.IsNullOrEmpty(HomeAddressActivity.MyIndex) &&
         String.IsNullOrEmpty(HomeAddressActivity.MyNotation) &&
         String.IsNullOrEmpty(NewCardAddressMapActivity.Lat) &&
         String.IsNullOrEmpty(NewCardAddressMapActivity.Lng)
         )
     {
         //address_mainBn.SetBackgroundImage(null, UIControlState.Normal);
         //address_mainBn.SetBackgroundImage(UIImage.FromBundle("button_inactive.png"), UIControlState.Normal);
         _homeAddressTv.SetTextColor(Resources.GetColor(Resource.Color.editTextLineColor));//UIColor.FromRGB(146, 150, 155)/*FromRGB(75, 75, 75)*/, UIControlState.Normal);
     }
     else
     {
         _homeAddressTv.SetTextColor(Color.White);
     }
     CheckBirthdate();
     _socialNetworkTv.SetTextColor(Resources.GetColor(Resource.Color.editTextLineColor));
     foreach (var item in SocialNetworkAdapter.SocialNetworks)
     {
         if (!String.IsNullOrEmpty(item.UsersUrl))
         {
             _socialNetworkTv.SetTextColor(Resources.GetColor(Resource.Color.vk_white));
             break;
         }
     }
     ////timer.Elapsed += delegate
     ////{
     ////timer.Stop();
     ////timer.Dispose();
     ////InvokeOnMainThread(async () =>
     ////{
     if (!String.IsNullOrEmpty(MySurname))
     {
         _surnameEt.Text = MySurname;
     }
     if (!String.IsNullOrEmpty(MyName))
     {
         _nameMiddlenameEt.Text = MyName + " " + MyMiddlename;
     }
     if (!String.IsNullOrEmpty(MyPhone))
     {
         _mobilePhoneEt.Text = MyPhone;
     }
     if (!String.IsNullOrEmpty(MyEmail))
     {
         _emailEt.Text = MyEmail;
     }
     if (!String.IsNullOrEmpty(MyHomePhone))
     {
         _homePhoneEt.Text = MyHomePhone;
     }
     if (!String.IsNullOrEmpty(MySite))
     {
         if (MySite.ToLower().Contains("https://"))
         {
             MySite = MySite.Remove(0, "https://".Length);
         }
         _siteEt.Text = MySite;
     }
     if (!String.IsNullOrEmpty(MyDegree))
     {
         _degreeEt.Text = MyDegree;
     }
     if (!String.IsNullOrEmpty(MyCardName))
     {
         _cardNameEt.Text = MyCardName;
     }
     //UIApplication.SharedApplication.KeyWindow.EndEditing(true);
     ////await Task.Delay(300);
     //scrollView.ContentSize = new CoreGraphics.CGSize(View.Frame.Width, Convert.ToInt32(View.Frame.Height / 2));
     //if (deviceModel.Contains("e 5") || deviceModel.Contains("e 4") || deviceModel.ToLower().Contains("se"))
     //    scrollView.ContentSize = new CoreGraphics.CGSize(View.Frame.Width, Convert.ToInt32(View.Frame.Height * 1.8));
     //else
     //    scrollView.ContentSize = new CoreGraphics.CGSize(View.Frame.Width, Convert.ToInt32(View.Frame.Height * 2 - 350));
     //scrollView.ContentOffset = new CGPoint(0, 0);
     //scrollView.Hidden = false;
     //activityIndicator.Hidden = true;
     //    });
     //};
     //timer.Start();
 }
Beispiel #8
0
        protected void btnSave_Click(object sender, ImageClickEventArgs e)
        {
            // 저장
            if (txtID.Text.Trim() == "")
            {
                msg.Text = "아이디를 입력하세요";
                txtID.Focus();
                return;
            }



            // --> 이름을 입력하세요.
            if (txtName.Text.Trim() == "")
            {
                msg.Text = "이름을 입력하세요";
                txtName.Focus();
                return;
            }
            // --> 암호를 입력하세요.
            if (txtPWD.Text.Trim() == "")
            {
                msg.Text = "암호를 입력하세요";
                txtPWD.Focus();
                return;
            }
            if (txtPWD2.Text.Trim() == "")
            {
                msg.Text = "암호를 입력하세요";
                txtPWD2.Focus();
                return;
            }

            if (txtPWD.Text != txtPWD2.Text)
            {
                msg.Text = "암호가 서로 다릅니다";
                return;
            }

            // --> E-mail을  입력하세요.
            if (txtEmail.Text.Trim() == "")
            {
                msg.Text = "이메일을 입력하세요";
                txtEmail.Focus();
                return;
            }
            //이메일 형식
            if (txtEmail.Text != null)
            {
                Regex regex = new Regex("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$");
                Match m     = regex.Match(txtEmail.Text);
                if (m.Success)
                {
                    msg.Text = "이메일 통과";
                }

                else
                {
                    msg.Text = "이메일 형식으로 입력하세요";
                    txtEmail.Focus();
                    return;
                }
            }


            if (txtPhone.Text.Trim() == "")
            {
                msg.Text = "전화번호를 입력하세요";
                txtPhone.Focus();
                return;
            }

            //전화번호 정규식

            if (txtPhone.Text.Trim() != null)
            {
                Regex regex = new Regex(@"01[016789]{1}-[0-9]{3,4}-[0-9]{4}");
                Match m     = regex.Match(txtPhone.Text);
                if (m.Success)
                {
                }

                else
                {
                    msg.Text = "전화번호 형식으로 입력하세요";
                    txtPhone.Focus();
                    return;
                }
            }

            if (lbltitle.Text == "회원가입")
            {
                if (Button1.Enabled == true)
                {
                    msg.Text = "[아이디 중복]을 확인하세요";
                    txtID.Focus();
                    return;
                }
            }

            string sql = "";
            string pwd = MySite.MD5Hash(txtPWD.Text);

            if (Request["mode"] != null)
            {
                sql = "update member set m_pwd=@m_pwd, m_email = @m_email,m_phone = @m_phone where m_id='" + txtID.Text + "'";
                DBConn       conn = new DBConn();
                OleDbCommand cmd  = new OleDbCommand(sql, conn.GetConn());

                cmd.Parameters.Add("@m_pwd", pwd);
                cmd.Parameters.Add("@m_email", txtEmail.Text);
                cmd.Parameters.Add("@m_phone", txtPhone.Text);



                try
                {
                    cmd.ExecuteNonQuery();
                    Response.Write("<script>alert('정보 수정 완료.');</script>");
                }
                catch (Exception ee)//버튼 이벤트 변수가 e
                {
                    Response.Write("<script>alert('정보 수정 실패.');</script>");
                }
                finally
                {
                    conn.Close();
                }
            }
            else
            {
                sql = "insert into member(m_id,m_name,m_pwd,m_email,m_phone) values(@m_id,@m_name,@m_pwd,@m_email,@m_phone)";

                DBConn       conn = new DBConn();
                OleDbCommand cmd  = new OleDbCommand(sql, conn.GetConn());
                cmd.Parameters.AddWithValue("@m_id", txtID.Text);
                cmd.Parameters.AddWithValue("@m_name", txtName.Text);
                cmd.Parameters.AddWithValue("@m_pwd", pwd);
                cmd.Parameters.AddWithValue("@m_email", txtEmail.Text);
                cmd.Parameters.AddWithValue("@m_phone", txtPhone.Text);

                try
                {
                    cmd.ExecuteNonQuery();
                }



                catch (Exception ee)
                {
                    msg.Text = "오류가 있습니다."; // ee.Message;
                }
                finally
                {
                    conn.Close();
                }
            }

            Response.Redirect("~/Default.aspx");
        }