Exemplo n.º 1
0
        private void cerrarSesiónToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tsec.Stop();
            Tmin.Stop();
            Thora.Stop();
            //eliminado cession abierta
            ClsNlogin Neg = new ClsNlogin();

            Neg.MtdCerrarSesion(data.Rows[0][9].ToString());
            //enviando sms
            ClsEsms En = new ClsEsms();
            ClsNsms Ne = new ClsNsms();

            En.Destinatario = "+51" + data.Rows[0][5].ToString();
            En.Mensaje      = "El usuario " + data.Rows[0][1].ToString() + " " + data.Rows[0][2].ToString() + " acaba de cerrar sesion a las " + DateTime.Now.ToLongTimeString() + ". \n La sesion estuvo abierta durante: " + Horas + " horas, " + Minutos + " minutos y " + Segundos + " segundos.";
            Ne.MtdMandarMensaje(En);

            //enviado mensaje al correo
            ClsEcorreo E = new ClsEcorreo();
            ClsNcorreo N = new ClsNcorreo();

            E.Asunto       = "CIERRE DE SESION";
            E.Destinatario = data.Rows[0][4].ToString();
            E.Mensaje      = "Usted acaba de cerrar sesion a las " + DateTime.Now.ToLongTimeString() + ". \n Su sesion estuvo abierta durante: " + Horas + " horas, " + Minutos + " minutos y " + Segundos + " segundos.";
            N.MtdEnviarEmail(E);
            frmLoginAdmin.MtdAuditoria(frmAdministrador.data.Rows[0][0].ToString(), "Cerro sesión");
            frmLoginAdmin f = new frmLoginAdmin();

            this.Close();
            f.Show();
        }
Exemplo n.º 2
0
        public frmAdministrador(DataTable datos)
        {
            InitializeComponent();
            data    = datos;
            ingreso = DateTime.Now.ToLongTimeString();
            Tsec.Start();
            Thora.Start();
            Tmin.Start();
            ClsNcargo N = new ClsNcargo();

            foreach (DataRow item in N.MtdListarCargos().Rows)
            {
                if (datos.Rows[0][6].ToString() == item[0].ToString())
                {
                    lblCargo.Text = item[1].ToString();
                    break;
                }
            }
            lblNombre.Text = datos.Rows[0][1].ToString() + " " + datos.Rows[0][2].ToString();
            lblCorreo.Text = datos.Rows[0][4].ToString();
            if (datos.Rows[0][6].ToString() == "002")
            {
                btnCargos.Enabled    = false;
                btnEmpleados.Enabled = false;
                btnProveedor.Enabled = false;
                btnReportes.Enabled  = false;
                btnKardex.Enabled    = false;
                btnCompras.Enabled   = false;
            }
            SidePanel.Height = BtnClientes.Height;
            SidePanel.Top    = BtnClientes.Top;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true if WeatherInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of WeatherInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(WeatherInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                     ) &&
                 (
                     Tmax == other.Tmax ||
                     Tmax != null &&
                     Tmax.Equals(other.Tmax)
                 ) &&
                 (
                     Tmin == other.Tmin ||
                     Tmin != null &&
                     Tmin.Equals(other.Tmin)
                 ) &&
                 (
                     Rainfall == other.Rainfall ||
                     Rainfall != null &&
                     Rainfall.Equals(other.Rainfall)
                 ) &&
                 (
                     Wmean == other.Wmean ||
                     Wmean != null &&
                     Wmean.Equals(other.Wmean)
                 ) &&
                 (
                     Wmax == other.Wmax ||
                     Wmax != null &&
                     Wmax.Equals(other.Wmax)
                 ) &&
                 (
                     Insolation == other.Insolation ||
                     Insolation != null &&
                     Insolation.Equals(other.Insolation)
                 ) &&
                 (
                     Sunshine == other.Sunshine ||
                     Sunshine != null &&
                     Sunshine.Equals(other.Sunshine)
                 ));
        }
Exemplo n.º 4
0
        public byte[] ToByte()
        {
            byte[] data = new byte[NSize];

            // File format version 2 is min -> N -> Sum -> max -> Squared Sum -> Tmin ->  Tmax
            data[0] = 0x01;
            BitConverter.GetBytes(Min).CopyTo(data, 1);
            BitConverter.GetBytes(N).CopyTo(data, 9);
            BitConverter.GetBytes(Sum).CopyTo(data, 13);
            BitConverter.GetBytes(Max).CopyTo(data, 13 + 8);
            BitConverter.GetBytes(SquaredSum).CopyTo(data, 21 + 8);
            BitConverter.GetBytes(Tmin.ToBinary()).CopyTo(data, 21 + 8 + 8);
            BitConverter.GetBytes(Tmax.ToBinary()).CopyTo(data, 21 + 8 + 8 + 8);
            return(data);
        }
Exemplo n.º 5
0
        public byte[] ToByte()
        {
            // Version 2 => Continuation (1b) => N, Sum, Min, Max
            byte[] data = new byte[NSize];
            data[0] = 0x02;
            BitConverter.GetBytes(Continuation).CopyTo(data, 1);
            BitConverter.GetBytes(Count).CopyTo(data, 2);
            BitConverter.GetBytes(Sum).CopyTo(data, 2 + 4);
            BitConverter.GetBytes(Min).CopyTo(data, 6 + 8);
            BitConverter.GetBytes(Max).CopyTo(data, 14 + 8);
            BitConverter.GetBytes(Tmin.ToBinary()).CopyTo(data, 22 + 8);
            BitConverter.GetBytes(Tmax.ToBinary()).CopyTo(data, 30 + 8);

            return(data);
        }
        public FormSeguridadCiudana(DataTable datos)
        {
            InitializeComponent();
            data    = datos;
            ingreso = DateTime.Now.ToLongTimeString();
            Tsec.Start();
            Thora.Start();
            Tmin.Start();
            ClsNcargo N = new ClsNcargo();

            foreach (DataRow item in N.MtdListarCargos().Rows)
            {
                if (datos.Rows[0][6].ToString() == item[0].ToString())
                {
                    lblCargo.Text = item[1].ToString();
                    break;
                }
            }
            lblNombre.Text   = datos.Rows[0][1].ToString() + " " + datos.Rows[0][2].ToString();
            lblCorreo.Text   = datos.Rows[0][4].ToString();
            SidePanel.Height = btnSeguCiudGeolocalizador.Height;
            SidePanel.Top    = btnSeguCiudGeolocalizador.Top;
            SidePanel.Height = btnSeguCiudGeolocalizador.Height;
            SidePanel.Top    = btnSeguCiudGeolocalizador.Top;
            if (Application.OpenForms.OfType <RelojCliente.FormPanelSegurCiud_Geolocalizador>().Count() < 0)
            {
                MessageBox.Show("Abierto");
            }
            else
            {
                if (_objForm != null)
                {
                    _objForm.Close();
                }
                _objForm = new RelojCliente.FormPanelSegurCiud_Geolocalizador
                {
                    TopLevel = false,
                    Dock     = DockStyle.Fill
                };
                panelContenedor.Controls.Add(_objForm);
                _objForm.Show();
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Date != null)
         {
             hashCode = hashCode * 59 + Date.GetHashCode();
         }
         if (Tmax != null)
         {
             hashCode = hashCode * 59 + Tmax.GetHashCode();
         }
         if (Tmin != null)
         {
             hashCode = hashCode * 59 + Tmin.GetHashCode();
         }
         if (Rainfall != null)
         {
             hashCode = hashCode * 59 + Rainfall.GetHashCode();
         }
         if (Wmean != null)
         {
             hashCode = hashCode * 59 + Wmean.GetHashCode();
         }
         if (Wmax != null)
         {
             hashCode = hashCode * 59 + Wmax.GetHashCode();
         }
         if (Insolation != null)
         {
             hashCode = hashCode * 59 + Insolation.GetHashCode();
         }
         if (Sunshine != null)
         {
             hashCode = hashCode * 59 + Sunshine.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 8
0
        private async void cerrarSesiónToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Tsec.Stop();
            Tmin.Stop();
            Thora.Stop();
            //eliminado cession abierta
            ClsNlogin Neg = new ClsNlogin();

            Neg.MtdCerrarSesion(data.Rows[0][9].ToString());
            //enviando sms
            ClsEsms En = ClsEsms.crear("+51" + data.Rows[0][5].ToString(), "El usuario " + data.Rows[0][1].ToString() + " " + data.Rows[0][2].ToString() + " acaba de cerrar sesion a las " + DateTime.Now.ToLongTimeString() + ". \n La sesion estuvo abierta durante: " + Horas + " horas, " + Minutos + " minutos y " + Segundos + " segundos.");
            ClsNsms Ne = new ClsNsms();

            Ne.MtdMandarMensaje(En);
            //enviado mensaje al correo
            ClsEcorreo E = ClsEcorreo.crear(data.Rows[0][4].ToString(), "CIERRE DE SESION", "Usted acaba de cerrar sesion a las " + DateTime.Now.ToLongTimeString() + ". \n Su sesion estuvo abierta durante: " + Horas + " horas, " + Minutos + " minutos y " + Segundos + " segundos.");
            ClsNcorreo N = new ClsNcorreo();
            await N.MtdEnviarEmail(E);

            this.Close();
        }
Exemplo n.º 9
0
 public override ParamData GetParamData()
 {
     try
     {
         ParamData pd = new ParamExtrusionData(xFunction, yFunction, zFunction, xPrimeFunction, yPrimeFunction, Smin.ToString(), Smax.ToString(),
                                               Tmin.ToString(), Tmax.ToString(), NumFacetS, NumFacetT, colorString, null);
         pd.BackColorString      = backColorString;
         pd.Opaque               = !translucent;
         pd.ImageSource          = imageSource;
         pd.ImageTiled           = imageTiled;
         pd.ImageTransformMatrix = imageTransformMatrix;
         pd.TransformMatrix      = transformMatrix;
         if (Children != null && Children.Count > 0)
         {
             foreach (ParameterObjectData p in Children)
             {
                 pd.Children.Add(p.GetParamData());
             }
         }
         return(pd);
     }
     catch { return(null); }
 }
Exemplo n.º 10
0
        private void Calc()
        {
            double Pk, L, Ti, Tm, Gp, Tp, Var_A, Var_B, D1, k, k_Qnpp, Tmin, Tmax;
            int    n, Qz, Qnpp;

            ClearResult();

            if (kToolStripMenuItem.Checked == true)
            {
                k_Qnpp = 0.7;
            }
            else
            {
                k_Qnpp = 1;
            }

            try
            {
                Pk   = Convert.ToDouble(txtPk.Text);
                L    = Convert.ToDouble(txtL.Text);
                n    = Convert.ToInt16(txtn.Text);
                Qz   = Convert.ToInt16(txtQz.Text);
                Ti   = Convert.ToDouble(txtT1.Text);
                Qnpp = Convert.ToInt16(txtQnpp.Text);

                Qz   = Qz * 1000;
                Qnpp = Qnpp * 1000;

                Tm = Ti / 60;

                Gp = 4 * Pk * L * n;

                Tp = 3600 * Gp / Qz;

                Var_A = Qz * Tm - 60 * Gp;

                //Var_B = 0.7 * Qnpp;
                Var_B = k_Qnpp * Qnpp;

                D1 = Var_A / (Var_B * Tm) * 100;

                k = Tp / Ti;

                Tmin = (6 * 60 * Gp) / (100 * Qz / 1000 - k_Qnpp * Qnpp / 1000);
                Tmax = (6 * 60 * Gp) / (k_Qnpp * Qnpp / 1000 + 100 * Qz / 1000);


                label1.Text = label1.Text + " " + Gp.ToString("0.###") + " кг";
                label4.Text = label4.Text + " " + Tp.ToString("0.###") + " c";

                label5.Text = label5.Text + " " + Tmax.ToString("0.###") + " c";
                label7.Text = label7.Text + " " + Tmin.ToString("0.###") + " c";

                label6.Text = label6.Text + " " + k.ToString("0.###");
                label3.Text = label3.Text + " " + D1.ToString("0.##") + " %";



                if (D1 > 1 || D1 < -1)
                {
                    lblError.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Проверьте введенные данные!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            // MessageBox.Show(Pk.ToString("0.##"));
        }