private void button1_Click(object sender, EventArgs e)
        {
            EngineProject  Funcion     = new EngineProject();
            EngineHttp     FuncionHttp = new EngineHttp();
            EngineTool     Tool        = new EngineTool();
            EngineProcesor Proceso     = new EngineProcesor(FuncionHttp, Funcion, Tool);

            if (string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty(txtRef.Text) || string.IsNullOrEmpty(txtEmail.Text) || string.IsNullOrEmpty(txtDevice.Text) || string.IsNullOrEmpty(txtTlf.Text))
            {
                MessageBox.Show("Todos los campos son requeridos", "INFORMACION DEL SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (!Tool.EmailEsValido(txtEmail.Text))
            {
                MessageBox.Show("Email no valido", "INFORMACION DEL SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            Proceso.Company(txtName.Text, txtEmail.Text, txtRef.Text, txtTlf.Text, txtDevice.Text);

            /*txtName.Text = string.Empty;
             * txtEmail.Text = string.Empty;
             * txtRef.Text = string.Empty;
             * txtTlf.Text = string.Empty;
             * txtDevice.Text = string.Empty;*/
        }
        public static string  LoginUser(string user, string password, string session)
        {
            ResponseWM response = new ResponseWM();

            password = EngineTool.ConvertirBase64(user + password);
            EngineDb Method = new EngineDb();
            bool     result = Method.LoginUser(user, password);

            if (result)
            {
                System.Web.HttpContext.Current.Session["User"] = user;
                if (session == "si")
                {
                    EngineProject Function = new EngineProject();
                    Function.CreateGalleta();
                }
                response.Description = "Autentificacion Exitosa";
                response.Result      = true;
            }
            else
            {
                response.Description = "Autentificacion Fallida";
                response.Result      = false;
                System.Web.HttpContext.Current.Session["User"] = null;
            }
            return(JsonConvert.SerializeObject(response));
        }
Exemple #3
0
        private void UpdatePersonFoto()
        {
            var           tool    = new EngineTool();
            var           Funcion = new EngineHttp();
            EngineProject project = new EngineProject();

            project.UpdatePersonFoto(tool, Funcion);
        }
        public static string RemoveLogin()
        {
            EngineProject Function = new EngineProject();

            Function.RemoveLogin();
            ResponseWM response = new ResponseWM();

            response.Description = "Sesion cerrada";
            response.Result      = true;
            System.Web.HttpContext.Current.Session["User"] = null;
            return(JsonConvert.SerializeObject(response));
        }
Exemple #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         EngineProject Funcion = new EngineProject();
         Funcion.GetGalleta();
     }
     if (System.Web.HttpContext.Current.Session["User"] != null)
     {
         userName.InnerText   = System.Web.HttpContext.Current.Session["User"].ToString();
         logSession.InnerText = "Cerrar Session";
     }
     else
     {
         userName.InnerText   = "";
         logSession.InnerText = "";
     }
 }
Exemple #6
0
        public static string CreateAdministrator(string name, string lastName, string user, string password)
        {
            ResponseWM response = new ResponseWM();

            response.Description = "Fallo crear administrador";
            response.Result      = false;
            try
            {
                password = EngineTool.ConvertirBase64(user + password);
                EngineProject Funcion = new EngineProject();
                Administrator adm     = Funcion.SetAdministrator(name, lastName, user, password);
                EngineDb      Metodo  = new EngineDb();
                bool          result  = Metodo.CreateAdministrator(adm);
                if (result)
                {
                    response.Description = "Administrador creado satisfactoriamente";
                    response.Result      = true;
                }
            }
            catch { }

            return(JsonConvert.SerializeObject(response));
        }