示例#1
0
文件: Login.cs 项目: MBLopez/Asada07
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     usu = new Usuario();
     pr = new Principal(usu);
     pr.Show();
     this.Hide();
 }
示例#2
0
文件: Program.cs 项目: GCA7/Asada07
 static void Main()
 {
     Usuario usu = new Usuario();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Principal(usu));
 }
示例#3
0
文件: Login.cs 项目: MBLopez/Asada07
 /// <summary>
 /// Evento click del boton aceptar
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnAceptar_Click(object sender, EventArgs e)
 {            
     usu = new Usuario();
     //pr = new Principal(usu);
     pr = (Principal) this.Owner;
     if (txtPassword.Text.Trim() == "" || txtUser.Text.Trim() == "")
     {
         MessageBox.Show(this, "Campos en blanco detectados, verifique!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         usu.Name = txtUser.Text.Trim();
         usu.Password = txtPassword.Text.Trim();
         con = new Connection(usu);
         if (con.Conexion())
         {
             this.Hide();
             pr.Pri_Load(usu);
             pr.Show();                    
         }
         else
         {
             MessageBox.Show(this, "Usuario o contraseña incorrectos, Verifique!", "Advertencia!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
示例#4
0
 public frmAbonados(Usuario us, Abonado ab)
 {
     InitializeComponent();
     this.usu = us;
     this.abo = ab;
     this.Abo_Load(abo,usu);
 }
示例#5
0
 public frmPrevistas(Usuario usu, Prevista pv)
 {
     InitializeComponent();
     this.user = usu;
     this.prv = pv;
     this.ValidUtils(prv);
     this.Prev_Load(usu,prv);
 }
示例#6
0
文件: Principal.cs 项目: GCA7/Asada07
 public void Pri_Load(Usuario user)
 {
     this.usu = user;
     if (this.usu.Name == null)
     {
         archivoToolStripMenuItem.Enabled = false;
         reportesToolStripMenuItem.Enabled = false;
         nosotrosToolStripMenuItem.Enabled = false;
         logInToolStripMenuItem.Enabled = true;
         logOutToolStripMenuItem.Enabled = true;
     }
     else
     {
         this.Update();
         archivoToolStripMenuItem.Enabled = true;
         reportesToolStripMenuItem.Enabled = true;
         nosotrosToolStripMenuItem.Enabled = true;
     }
 }
示例#7
0
        public void Abo_Load(Abonado ab, Usuario user)
        {
            abo = new Abonado();
            abo = ab;

            if (radioButton1.Checked == true)
            {
                MtxtIdentification.Mask = "00-0000-0000";
                
            }
            else
            {
                MtxtIdentification.Mask = "00-0000-0000-0000-0000";
            }

            if (abo.Identification == null)
            {
                btnSaveUpdate.Text = "Guardar";
                MtxtIdentification.Enabled = true;   // txt modo sin edicion
                MtxtIdentification.ReadOnly = false; // txt modo solo lectura 
                return;
            }
            else
            {
                btnSaveUpdate.Text = "Editar";
                MtxtIdentification.AppendText(abo.Identification.ToString());
                MtxtIdentification.Enabled = false; 
                MtxtIdentification.ReadOnly = true; 
                TxtName.Text = abo.Name.ToString();
                TxtFirstN.Text = abo.Firstname.ToString();
                TxtLastN.Text = abo.Lastname.ToString();
                MtxtMovil.Text = abo.Movil.ToString();
                MtxtPhone.AppendText(abo.Phonenum.ToString());
                TxtEmail.Text = abo.Email.ToString();
                dateTimePicker1.Text = abo.Dateregister.ToString();
                TxtAddress.Text = abo.Address.ToString();
            }            
        }
示例#8
0
        public void Prev_Load(Usuario usu, Prevista prv)
        {
            // Llena el combobox tarifas
            //trfDao = new TarifaDAO(this.user);
            //cbxRate.DisplayMember = "TypeAppString";
            //cbxRate.ValueMember = "Code";
            //cbxRate.DataSource = trfDao.LoadTarifa();
            cbxRate.Items.Add("Mensual Fija");
            cbxRate.Items.Add("Metros Cúbicos");
            cbxRate.SelectedItem = 0;

            // LLena el combo de Abonados
            abnDao = new AbonadoDAO(this.user);
            cbxAbonado.DisplayMember = "Name";
            cbxAbonado.ValueMember = "Identification";
            if (abnDao.LoadAbonado1().Count > 0)
            {
                cbxAbonado.DataSource = abnDao.LoadAbonado1();
            }
            else
            {
                MessageBox.Show("No hay abonados disponibles para asignar a las previstas!", "Atención");
                //mostrar popup, notificacion o mensaje en un label o formulario, por al menos 3 segundos 
            }

            // obtiene el consecutivo de previstas
            prvDao = new PrevistaDAO(this.user);
            txtCode.Text = prvDao.ConsecutivePrv().ToString();
            txtCode.ReadOnly = true;
            txtCode.Enabled = false;

            // se obtienen y establecen los sectores
            secDao = new SectorDAO(this.user);
            cbxSector.DisplayMember = "Description";
            cbxSector.ValueMember = "Code";
            cbxSector.DataSource = secDao.LoadSector();
        }
示例#9
0
 public SerchAbonado(Usuario us)
 {
     InitializeComponent();
     this.usu = us;
 }
示例#10
0
 public Connection(Usuario usu)
 {
     this.user = usu;
 }
示例#11
0
 public SectorDAO(Usuario us)
 {
     this.user = us;
 }
示例#12
0
 public AbonadoDAO(Usuario usu)
 {
     this.user = usu;
 }
示例#13
0
 public PrevistaDAO(Usuario usu)
 {
     this.user = usu;
 }
示例#14
0
 public TarifaDAO(Usuario usu)
 {
     this.user = usu;
 }
示例#15
0
文件: Principal.cs 项目: GCA7/Asada07
 public Principal(Usuario user)
 {
     InitializeComponent();
     this.usu = user;
     this.Pri_Load(usu);
 }
示例#16
0
        //private string columnName = "", filterValue = "", rowFilter = "";

        public SerchPrevista(Usuario us)
        {
            InitializeComponent();
            this.user = us;
        }