コード例 #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            int newPoint = Convert.ToInt32(frmpoint.Value);
            int oldPoint = newmember.point;
            newmember.point = newPoint;
            newmember.Update();
            if (newPoint != oldPoint)
            {
                PointHistory pointhistory = new PointHistory();
                pointhistory.UseTime           = DateTime.Now;
                pointhistory.MemberId          = id;
                pointhistory.Point             = newmember.point - Point;
                pointhistory.CurrentPointCount = newmember.point;
                pointhistory.ItemName          = "后台会员管理修改积分";
                pointhistory.Save();
            }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", @"alert('成功!');
(function(){
    var load=window.onload;
    window.onload=function(){
        try{
            if(load) load();
            parent.Dialog.CloseAndRefresh(frameElement);
        }catch(e){};
    };
})();
", true);
        }
        catch (Exception ex)
        {
        }
    }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             string account     = Request.Form["Account"];
             string password    = Request.Form["Password"];
             member loginMember = member.Login(account, password);
             if (loginMember != null)
             {
                 //if (loginMember.active == 2)
                 //{
                 //    errorMsg = "not_active";
                 //}
                 //else
                 if (loginMember.active == 3)
                 {
                     errorMsg = "not_used";
                 }
                 else
                 {
                     loginMember.lastLoginDate = System.DateTime.Now;
                     if (loginMember.Update() != 1)
                     {
                         errorMsg = "error";
                     }
                     else
                     {
                         errorMsg = "success";
                     }
                 }
             }
         }
         catch (ThreadAbortException) { }
         catch (Exception ex)
         {
             errorMsg = "account_error";
         }
     }
     Response.Write(errorMsg);
 }
コード例 #3
0
ファイル: member_login.aspx.cs プロジェクト: hillterry/Jetso
 protected void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string account     = Request.Form["Account1"];
         string password    = Request.Form["Password1"];
         member loginMember = member.Login(account, password);
         if (loginMember != null)
         {
             loginMember.lastLoginDate = System.DateTime.Now;
             if (loginMember.Update() != 1)
             {
                 Response.Write("error");
             }
             else
             {
                 Response.Redirect("../Jesto/member_coupon.aspx");
             }
         }
     }
     catch (ThreadAbortException) { }
     catch (Exception ex)
     {
         String msg = "帳號或者密碼錯誤!";
         msg += "," + ex.Message;
         if (ex is EntityException)
         {
             msg += "," + ex.Message;
         }
         else
         {
             HmTrace.WriteException(ex);
         }
         errorMsg = msg;
     }
 }