private void Guardarbutton_Click(object sender, EventArgs e) { BLL.Login user = new BLL.Login(); if (NombretextBox.TextLength > 0 && NombreUsuariotextBox.TextLength > 0) { user.Nombre = NombretextBox.Text; user.NombreUsuario = NombreUsuariotextBox.Text; user.Contrasena = ContrasenatextBox.Text; user.Fecha = dateTimePicker.ToString(); } if(user.Insertar()) { MessageBox.Show("Usuario guardado Correctamente"); } else { MessageBox.Show("Error! no se guardo el Usuario"); } }
/// <summary> /// 页面加载 /// </summary> /// <param name="sender">系统传参</param> /// <param name="e">系统传参</param> protected void Page_Load(object sender, EventArgs e) { //在此构造一个BLL业务类 this.login = new BLL.Login(); }
// Delete public static bool DeleteLogin(Login pLogin) { return(DALLogin.DeleteLogin(pLogin)); }
// Update public static bool UpdateLogin(Login pLogin) { return(DALLogin.SetLogin(pLogin)); }
// Create public static int CreateLogin(Login pLogin) { return(DALLogin.AddLogin(pLogin)); }
/// <summary> /// 保存用户基本信息和登陆信息 /// </summary> /// <param name="sessionModel"></param> /// <param name="account"></param> /// <param name="employee"></param> /// <returns></returns> private IEnumerable <string> GetUserSession(ref LoginSessionModel sessionModel, Login account, Employee employee) { //不保存登陆密码信息 account.LoginPassword = ""; account.Salt = ""; sessionModel.Account = account; List <string> list = new List <string>(); //获取员工基本信息 sessionModel.Employee = employee; //获取员工的应用程序权限 var appids = EmployeeApplicationDAL.GetModels(u => u.Enable && u.EmployeeId == employee.EmployeeId).Select(u => u.ApplicationId); if (!appids.IsNullOrEmpty()) { list = appids.ToList(); } return(list); }