예제 #1
0
        private void btnINGRESAR_Click(object sender, EventArgs e)
        {
            try
            {
                EsValido = true;
                if (!ValidateChildren() || !EsValido)
                {
                    DialogResult = DialogResult.None;
                    return;
                }

                USUARIO usuario = (USUARIO)cmbUsuario.SelectedItem;
                eSESION = new LOG();
                if (!Validar(usuario, txtPassword.Text))
                {
                    txtPassword.Text = string.Empty;
                    txtPassword.Focus();
                    return;
                }
                eSESION.USUARIO = eUSUARIO;
                eSESION.FECHALOGIN = DateTime.Now;
                eSESION.MAC = COMMON.MetodosComunes.LeerMacAddress();
                eSESION = cLOGIN.InicioSesion(eSESION);
                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                ProcesarExcepcion(ex);
                DialogResult = DialogResult.None;
            }
        }
예제 #2
0
 public LOG InicioSesion(LOG eSesion)
 {
     using (AUDITORIA_SUPERMERCADOEntities ctx = AUDITORIA_SUPERMERCADOEntities.ObtenerInstancia())
     {
         ctx.AddToLOG(eSesion);
         ctx.SaveChanges();
         return eSesion;
     }
 }
예제 #3
0
 public void CierreSesion(LOG eSesion)
 {
     using (AUDITORIA_SUPERMERCADOEntities ctx = AUDITORIA_SUPERMERCADOEntities.ObtenerInstancia())
     {
         ctx.LOG.Attach(eSesion);
         ctx.ObjectStateManager.ChangeObjectState(eSesion, System.Data.EntityState.Modified);
         ctx.SaveChanges();
     }
 }
예제 #4
0
        public frmPRINCIPAL(LOG pSesion, CONTROLADORA.cLOGIN pLogin)
        {
            var a = new Splash();
            a.ShowDialog();

            InitializeComponent();

            eSESION = pSesion;
            cLOGIN = pLogin;
        }
예제 #5
0
        private bool Loguin()
        {
            //lbGrupos.Visible = false;
            eUSUARIO = null;
            lblUSUARIO.Text = "";
            msMENU.Items.Clear();
            frmLOGIN formLOGIN = new frmLOGIN();
            DialogResult drLOGIN = formLOGIN.ShowDialog();

            if (drLOGIN != DialogResult.OK)
            {
                Application.Exit();
                return false;
            }

            eSESION = formLOGIN.SESION;
            eUSUARIO = eSESION.USUARIO;
            txtUsuario.Text = eUSUARIO.USU_NOMBRE;
            return true;
        }
 /// <summary>
 /// Create a new LOG object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="uSU_CODIGO">Initial value of the USU_CODIGO property.</param>
 /// <param name="fECHALOGIN">Initial value of the FECHALOGIN property.</param>
 public static LOG CreateLOG(global::System.Int32 id, global::System.Int32 uSU_CODIGO, global::System.DateTime fECHALOGIN)
 {
     LOG lOG = new LOG();
     lOG.ID = id;
     lOG.USU_CODIGO = uSU_CODIGO;
     lOG.FECHALOGIN = fECHALOGIN;
     return lOG;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the LOG EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLOG(LOG lOG)
 {
     base.AddObject("LOG", lOG);
 }
예제 #8
0
 public LOG InicioSesion(LOG eSesion)
 {
     return mSESIONES.InicioSesion(eSesion);
 }
예제 #9
0
 public void CierreSesion(LOG eSesion)
 {
     eSesion.FECHALOGOUT = DateTime.Now;
     mSESIONES.CierreSesion(eSesion);
 }