コード例 #1
0
ファイル: UserControl1.cs プロジェクト: trogalko/Rscm_Bku
 private void button1_Click(object sender, EventArgs e)
 {
     AppUser AppUser = new AppUser();
     if (AppUser.LoadByPrimaryKey(textBox1.Text))
     {
         if (AppUser.Password == RSCM_BKU_Web_Winform.AEScipher.Encrypt(textBox1.Text, textBox2.Text))
         {
             Session["UserId"] = AppUser.UserID;
             Session["UserName"] = AppUser.UserName;
             AuditTrail AuditTrail = new AuditTrail();
             string itemAction = "Login per Tanggal : " + DateTime.Now.ToShortDateString() + " , untuk UserID : " + AppUser.UserID;
             if (itemAction.Length > 200)
                 itemAction = itemAction.Substring(0, 200);
             AuditTrail.ItemAction = itemAction;
             AuditTrail.Aksi = "LOGIN";
             AuditTrail.DateAction = DateTime.Now;
             AuditTrail.Save();
             Context.Redirect("~Default.aspx");
         }
         else
             return;
     }
     else
         return;
 }
コード例 #2
0
ファイル: Login.aspx.cs プロジェクト: trogalko/RSCM_BKU_web
        protected void Button1_Click(object sender, EventArgs e)
        {
            AppUser AppUser = new AppUser();
            if (AppUser.LoadByPrimaryKey(txtUserId.Text.Trim()))
            {
                if (AppUser.Password == AEScipher.Encrypt(txtUserId.Text, txtPassword.Text))
                {
                    HttpContext.Current.Session["UserId"] = AppUser.UserID;
                    HttpContext.Current.Session["UserName"] = AppUser.UserName;

                    AuditTrail AuditTrail = new AuditTrail();
                    string itemAction = "Login per Tanggal : " + DateTime.Now.ToShortDateString() + " , untuk UserID : " + AppUser.UserID;
                    if (itemAction.Length > 200)
                        itemAction = itemAction.Substring(0, 200);
                    AuditTrail.ItemAction = itemAction;
                    AuditTrail.Aksi = "LOGIN";
                    AuditTrail.DateAction = DateTime.Now;
                    AuditTrail.Save();
                    Response.Redirect("~/Default.aspx");
                }
                else
                    return;
            }
            else
                return;
        }
コード例 #3
0
 protected void Save(object sender, DirectEventArgs e)
 {
     this.formAdd.Title = this.cmbKelompokAnggaran.SelectedItem.Text;
     AuditTrail at = new AuditTrail();
     at.Aksi = txtTransNumber.Text;
     at.DateAction = DateTime.Now;
     at.Save();
 }
コード例 #4
0
 virtual public AuditTrail AttachEntity(AuditTrail entity)
 {
     return(base.AttachEntity(entity) as AuditTrail);
 }