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; }
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; }
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(); }
virtual public AuditTrail AttachEntity(AuditTrail entity) { return(base.AttachEntity(entity) as AuditTrail); }