Example #1
0
        /// <summary>
        /// Initiates the connection to the app
        /// </summary>
        /// <returns>An async Task</returns>
        /// <exception cref="Exception">Thrown if the connection is refused</exception>
        public async Task Connect()
        {
            if (SocketId != null)
            {
                return;
            }
            ConnectCompletionSource = new TaskCompletionSource <bool>();
            uint nonce = Packet.WatchNonce(async pk =>
            {
                await Task.Run(() =>
                {
                    TcpCSSocketControl control = new TcpCSSocketControl(pk);
                    SocketId = control.SocketId;
                    EP.Connections.Add(IdToString(control.SocketId), this);
                    Requestor = true;
                    Stream    = new NRStream(this);
                    if (control.CheckFlag(TcpCSSocketControl.Close))
                    {
                        ConnectCompletionSource.SetResult(false);
                    }
                });
            });

            EP.TransmitRaw(new TcpCOpenSocket(InstanceId, nonce));
            bool success = await ConnectCompletionSource.Task;

            if (!success)
            {
                await Close(false);

                throw new Exception("Connect to distant end was refused.");
            }
        }
Example #2
0
 private void TextBox4_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (!(string.IsNullOrEmpty(TextBox4.Text)))
         {
             EP.Clear();
             char[] chars = TextBox4.Text.ToCharArray();
             for (int i = 0; i < TextBox4.Text.Length; i++)
             {
                 int code;
                 code = Convert.ToInt16(chars[i]);
                 if (!((!(code > 57 || code < 48)) || (code == 46)))
                 {
                     TextBox4.Text           = TextBox4.Text.Remove(i, 1);
                     TextBox4.SelectionStart = TextBox4.Text.Length;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error Code:- 14004", ex.Message);
         Global.Create_OnLog(ex.Message);
     }
 }
        private bool LosDatosIngresadosSonCorrectos()
        {
            LimpiarEP();

            if (Controles.IsNullOEmptyElControl(txtCodigo))
            {
                EP.SetError(txtCodigo, "Este campo no puede quedar vacío");
                txtCodigo.Focus();
                return(false);
            }

            if (Controles.IsNullOEmptyElControl(txtContenedor))
            {
                EP.SetError(txtContenedor, "Este campo no puede quedar vacío");
                txtContenedor.Focus();
                return(false);
            }

            if (Controles.IsNullOEmptyElControl(cmbSeccion))
            {
                EP.SetError(cmbSeccion, "Se debe seleccionar una sección");
                cmbSeccion.Focus();
                return(false);
            }


            return(true);
        }
    public void GongGaofillgv()            //用户自定义的方法
    {
        string        SqlStr = "select * from tb_GongGao order by GTime desc";
        SqlConnection con    = new SqlConnection(EP.GetConStr());

        con.Open();                         //打开数据库连接
        SqlDataAdapter sda = new SqlDataAdapter(SqlStr, con);
        DataSet        ds  = new DataSet(); //声明一个DataSet的对象,并将该对象ds实例化

        sda.Fill(ds, "tb_GongGao");         //将tb_GongGao填充到数据库中
        this.GvGongGao.DataSource = ds;
        this.GvGongGao.DataBind();          //将数据绑定到GridView控件中
        for (int i = 0; i <= this.GvGongGao.Rows.Count - 1; i++)
        {
            DataRowView mydrv;  //声明一个DataRowView的对象
            string      gintro; //声明一个字符串变量
            if (this.GvGongGao.PageIndex == 0)
            {
                EP.GetConStr();//调用EP类中的GetConStr()方法
                mydrv  = ds.Tables["tb_GongGao"].DefaultView[i];
                gintro = Convert.ToString(mydrv["content"]);
                this.GvGongGao.Rows[i].Cells[1].Text = ep.SubStr(gintro, 10);
            }
        }
        con.Close();//关闭数据库链接
    }
Example #5
0
        private Boolean LosDatosIngresadosSonCorrectos()
        {
            decimal Cantidad;

            decimal.TryParse(txtCantidad.Text, out Cantidad);
            if (Cantidad == 0)
            {
                EP.SetError(txtCantidad, "El valor no puede ser cero");
                txtCantidad.Focus();
                return(false);
            }

            DateTime FechaActual = System.DateTime.Now;

            if (dtpkFechaVencimiento.Checked == false)
            {
                EP.SetError(dtpkFechaVencimiento, "No se ha seleccionado una fecha de vencimiento del lote del producto");
                dtpkFechaVencimiento.Focus();
                return(false);
            }

            if (dtpkFechaVencimiento.Value.CompareTo(FechaActual) < 0)
            {
                EP.SetError(dtpkFechaVencimiento, "La fecha Ingresada de inicio de la promoción no puede ser menor que la fecha actual del SO");
                dtpkFechaVencimiento.Focus();
                return(false);
            }

            return(true);
        }
Example #6
0
 private void LimCombo_Leave(object sender, EventArgs e)
 {
     try
     {
         Common.FormatCombo(LimCombo);
         if (LimCombo.Text.Length <= 0)
         {
             EP.SetError(LimCombo, "Type the File Name First...");
             LimCombo.Focus();
             return;
         }
         else if (LimCombo.Text.Length <= 5)
         {
             EP.SetError(LimCombo, "The name should be More than 5 Letters...");
             LimCombo.Focus();
         }
         else if (((LimCombo.Text.Substring(0, 4)) == "Lim_") || ((LimCombo.Text.Substring(0, 4)) == "LIM_") || ((LimCombo.Text.Substring(0, 4)) == "lim_"))
         {
             LimCombo.Text = "lim_" + (LimCombo.Text.Substring(4)).ToLower();
             EP.Clear();
         }
         else
         {
             LimCombo.Text = "lim_" + LimCombo.Text.ToLower();
             EP.Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" LimCombo_Leave @ Error Code:-7013 " + ex.Message);
     }
 }
Example #7
0
        public string DEditar(EP EEP)
        {
            String        rpta   = "";
            SqlConnection SqlCon = new SqlConnection();

            try
            {
                SqlCon.ConnectionString = Conexion.Cn;
                SqlCon.Open();
                SqlCommand SqlCmd = new SqlCommand();
                SqlCmd.Connection  = SqlCon;
                SqlCmd.CommandText = "EPEditar";
                SqlCmd.CommandType = CommandType.StoredProcedure;

                SqlParameter ParID = new SqlParameter();
                ParID.ParameterName = "@ID";
                ParID.SqlDbType     = SqlDbType.Int;
                ParID.Value         = EEP.ID;
                SqlCmd.Parameters.Add(ParID);

                SqlParameter ParNombre = new SqlParameter();
                ParNombre.ParameterName = "@nombre";
                ParNombre.SqlDbType     = SqlDbType.VarChar;
                ParNombre.Size          = 30;
                ParNombre.Value         = EEP.Nombre;
                SqlCmd.Parameters.Add(ParNombre);

                SqlParameter ParCoordProy = new SqlParameter();
                ParCoordProy.ParameterName = "@Representante";
                ParCoordProy.SqlDbType     = SqlDbType.VarChar;
                ParCoordProy.Value         = EEP.Representante;
                SqlCmd.Parameters.Add(ParCoordProy);

                SqlParameter ParCoordInsp = new SqlParameter();
                ParCoordInsp.ParameterName = "@Correo";
                ParCoordInsp.SqlDbType     = SqlDbType.VarChar;
                ParCoordInsp.Value         = EEP.Correo;
                SqlCmd.Parameters.Add(ParCoordInsp);

                SqlParameter ParCorreoProy = new SqlParameter();
                ParCorreoProy.ParameterName = "@Telefono";
                ParCorreoProy.SqlDbType     = SqlDbType.VarChar;
                ParCorreoProy.Value         = EEP.Telefono;
                SqlCmd.Parameters.Add(ParCorreoProy);

                rpta = SqlCmd.ExecuteNonQuery() == 1 ? "OK" : "No se Editó el Registro";
            }
            catch (Exception ex)
            {
                rpta = ex.Message;
            }
            finally
            {
                if (SqlCon.State == ConnectionState.Open)
                {
                    SqlCon.Close();
                }
            }
            return(rpta);
        }
Example #8
0
        private void btnEditarDatos_Click(object sender, EventArgs e)
        {
            if (txtNombreAnterior.Text == string.Empty)
            {
                EP.SetError(txtNombreAnterior, "Campo requerido");
            }
            if (txtNuevoNombre.Text == string.Empty)
            {
                EP.SetError(txtNuevoNombre, "Campo requerido");
            }
            if (txtPassAdmin.Text == string.Empty)
            {
                EP.SetError(txtPassAdmin, "Campo requerido");
            }
            DialogResult OK;

            OK = MessageBox.Show("Seguro que deceas modificar la contraseña?", "Advertencia", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
            if (DialogResult.OK == OK)
            {
                if (crd.editarAdmin(txtNombreAnterior.Text, txtNuevoNombre.Text, txtPassAdmin.Text) == 1)
                {
                    MessageBox.Show("Modificacion realizada con exito", "Correcto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Algo ocurrio mal durante el proceso", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                txtNombreAnterior.Text = string.Empty;
                txtNombreAnterior.Text = string.Empty;
                txtPassAdmin.Text      = string.Empty;
            }
        }
Example #9
0
        private void btnAgregarUsuario_Click(object sender, EventArgs e)
        {
            if (txtNombreUsuario.Text == string.Empty)
            {
                EP.SetError(txtNombreUsuario, "Campo requerido");
            }
            if (txtPassUsuario.Text == string.Empty)
            {
                EP.SetError(txtPassUsuario, "Campo requerido");
            }
            DialogResult OK;

            OK = MessageBox.Show("Seguro que deceas agregar ujn nuevo usuario?", "Advertencia", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
            if (DialogResult.OK == OK)
            {
                if (crd.Create(txtNombreUsuario.Text, txtPassUsuario.Text) == 1)
                {
                    MessageBox.Show("Usuario agregado de manera exitosa.", "Correcto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Ocurrio un error durante el proceso", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private bool LosDatosIngresadosSonCorrectos()
        {
            LimpiarEP();

            if (Controles.IsNullOEmptyElControl(txtDescGrupoDeCuentas))
            {
                EP.SetError(txtDescGrupoDeCuentas, "Este campo no puede quedar vacío");
                txtDescGrupoDeCuentas.Focus();
                return(false);
            }

            if (Controles.IsNullOEmptyElControl(cmbCredito))
            {
                EP.SetError(cmbCredito, "Se debe seleccionar un valor");
                cmbCredito.Focus();
                return(false);
            }

            if (Controles.IsNullOEmptyElControl(cmbDebito))
            {
                EP.SetError(cmbCredito, "Se debe seleccionar un valor");
                cmbCredito.Focus();
                return(false);
            }


            return(true);
        }
Example #11
0
    public void LeaveWordfillgv()            //用户自定义的方法
    {
        string        SqlStr = "select * from tb_LeaveWord order by lTime desc";
        SqlConnection con    = new SqlConnection(EP.GetConStr());

        con.Open();                         //打开数据库连接
        SqlDataAdapter sda = new SqlDataAdapter(SqlStr, con);
        DataSet        ds  = new DataSet(); //声明一个DataSet的对象,并将该对象ds实例化

        sda.Fill(ds, "tb_LeaveWord");       //将tb_LeaveWord填充到数据库中
        this.GvLeaveWord.DataSource = ds;
        this.GvLeaveWord.DataBind();        //将数据绑定到GridView控件中
        for (int i = 0; i <= this.GvLeaveWord.Rows.Count - 1; i++)
        {
            DataRowView mydrv;  //声明一个DataRowView的对象
            string      gintro;

            if (this.GvLeaveWord.PageIndex == 0)
            {
                EP.GetConStr();

                mydrv  = ds.Tables["tb_LeaveWord"].DefaultView[i];
                gintro = Convert.ToString(mydrv["Title"]);
                this.GvLeaveWord.Rows[i].Cells[1].Text = ep.SubStr(gintro, 10);
            }
        }
        con.Close();
    }
Example #12
0
        public ActionResult DeleteConfirmed(int id)
        {
            EP eP = db.EPs.Find(id);

            db.EPs.Remove(eP);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #13
0
    protected void dlContent_DeleteCommand(object source, DataListCommandEventArgs e)
    {
        string ID     = this.dlContent.DataKeys[e.Item.ItemIndex].ToString();
        string sqlstr = "delete from tb_tools where ID='" + Convert.ToInt32(ID) + "'";

        EP.EXECCommand(sqlstr);//执行删除语句
        this.bindDataList();
    }
Example #14
0
        private void Test()
        {
            label16.Text = Environment.OSVersion.ToString();

            {
                Label la = label2;
                EP.SetError(la, null);
                try {
                    la.Text = new UseIsWow64Process().Is64BitOS() ? "64" : "32";
                }
                catch (Exception err) { EP.SetError(la, "失敗: " + err); }
            }

            {
                Label la = label4;
                EP.SetError(la, null);
                try {
                    la.Text = new UsePROCESSOR_ARCHITECTURE().IsOS64() ? "64" : "32";
                }
                catch (Exception err) { EP.SetError(la, "失敗: " + err); }
            }

            {
                Label la = label6;
                EP.SetError(la, null);
                try {
                    la.Text = new UseWMI().GetOSBits();
                }
                catch (Exception err) { EP.SetError(la, "失敗: " + err); }
            }

            {
                Label la = label9;
                EP.SetError(la, null);
                try {
                    la.Text = new UseGetSystemWow64Directory().Is64OS() ? "64" : "32";
                }
                catch (Exception err) { EP.SetError(la, "失敗: " + err); }
            }

            {
                Label la = label11;
                EP.SetError(la, null);
                try {
                    la.Text = new UseGetNativeSystemInfo().GetOSBits();
                }
                catch (Exception err) { EP.SetError(la, "失敗: " + err); }
            }

            {
                Label la = label13;
                EP.SetError(la, null);
                try {
                    la.Text = new UseIntPtr().GetOSBits();
                }
                catch (Exception err) { EP.SetError(la, "失敗: " + err); }
            }
        }
        private void AplicarCierreDelPeriodo()
        {
            try
            {
                if (LosDatosIngresadosSonCorrectos())
                {
                    LimpiarEP();
                    if (string.IsNullOrEmpty(txtDescripcion.Text) || txtDescripcion.Text.Trim().Length == 0)
                    {
                        EP.SetError(txtDescripcion, "El valor del campo no puede quedar vacío");
                        txtDescripcion.Focus();
                        return;
                    }

                    if (EvaluarSiHayRegistrosEnLaTablaTMP())
                    {
                        return;
                    }

                    //realiaremos un backup dela base de datos...
                    if (RespaldarBaseDeDatos())
                    {
                        this.Cursor = Cursors.WaitCursor;

                        CierreDePeriodoEN oRegistroEN = InformacionSobreELCierreDePeriodo();
                        CierreDePeriodoLN oRegistroLN = new CierreDePeriodoLN();

                        System.Threading.Thread.Sleep(10000);

                        timer1.Interval = 5000;
                        timer1.Start();

                        if (oRegistroLN.AgregarUtilizandoLaMismaConexion(oRegistroEN, Program.oDatosDeConexion))
                        {
                            EvaluarErrorParaMensajeAPantalla(oRegistroLN.Error, "CERRAR");

                            if (CerrarVentana == true)
                            {
                                this.Close();
                            }
                        }
                        else
                        {
                            throw new ArgumentException(oRegistroLN.Error);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Aplicar cierre de periodo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
    protected void dlTouxiang_DeleteCommand(object source, DataListCommandEventArgs e)
    {
        //获取主键字段的字段值,并且将获取的字段的值赋值给变量ID中
        string ID     = this.dlTouxiang.DataKeys[e.Item.ItemIndex].ToString();
        string sqlstr = "delete from tb_image where id='" + Convert.ToInt32(ID) + "'";

        EP.EXECCommand(sqlstr); //调用EP类的EXECCommand方法执行删除语句
        this.bindDataList();    //调用用户自定义bindDataList方法
    }
Example #17
0
        public object BindData(string action, Dictionary <string, object> extraParams)
        {
            StoreRequestParameters prms = new StoreRequestParameters(extraParams);

            int total;

            List <Employee> data = EP.GetEmployees(prms.Limit, prms.Start, out total);

            return(new { data, total });
        }
Example #18
0
    // Use this for initialization
    void Start()
    {
        //scriptEnable.SetActive(true);
        scriptEnable.GetComponent <WeaponController>().enabled = false;

        //retrieves the navmesh agent component and assigns it to the space we made earlier
        agent = GetComponent <NavMeshAgent>();

        //Check for the enemy patrol script. Returns null if one isn't attached.
        EP = GetComponent <EP>();
    }
Example #19
0
        private void DisplaySummary(string id)
        {
            Employee emp = EP.GetEmployee(id);

            if (emp == null)
            {
                Response.Redirect("~/Employees.aspx");
            }

            DisplaySummary(emp);
        }
Example #20
0
 public PR(EP ep, GP gp)
 {
     if (ep.Value == 0)
     {
         Value = 0;
     }
     else
     {
         Value = ep.Value / gp.Value;
     }
 }
Example #21
0
        public static string DInsertar(EP EEP)
        {
            String        rpta   = "";
            SqlConnection SqlCon = new SqlConnection();

            try
            {
                SqlCon.ConnectionString = Conexion.Cn;
                SqlCon.Open();
                SqlCommand SqlCmd = new SqlCommand();
                SqlCmd.Connection  = SqlCon;
                SqlCmd.CommandText = "EPInsertar";
                SqlCmd.CommandType = CommandType.StoredProcedure;

                SqlParameter ParNombre = new SqlParameter();
                ParNombre.ParameterName = "@nombre";
                ParNombre.SqlDbType     = SqlDbType.VarChar;
                ParNombre.Size          = 10;
                ParNombre.Value         = EEP.Nombre;
                SqlCmd.Parameters.Add(ParNombre);

                SqlParameter ParRepresentante = new SqlParameter();
                ParRepresentante.ParameterName = "@Representante";
                ParRepresentante.SqlDbType     = SqlDbType.VarChar;
                ParRepresentante.Value         = EEP.Representante;
                SqlCmd.Parameters.Add(ParRepresentante);

                SqlParameter ParCorreo = new SqlParameter();
                ParCorreo.ParameterName = "@Correo";
                ParCorreo.SqlDbType     = SqlDbType.Int;
                ParCorreo.Value         = EEP.Correo;
                SqlCmd.Parameters.Add(ParCorreo);

                SqlParameter ParTelefono = new SqlParameter();
                ParTelefono.ParameterName = "@Telefono";
                ParTelefono.SqlDbType     = SqlDbType.VarChar;
                ParTelefono.Value         = EEP.Telefono;
                SqlCmd.Parameters.Add(ParTelefono);

                rpta = SqlCmd.ExecuteNonQuery() == 1 ? "OK" : "No se ingreso el Registro";
            }
            catch (Exception ex)
            {
                rpta = ex.Message;
            }
            finally
            {
                if (SqlCon.State == ConnectionState.Open)
                {
                    SqlCon.Close();
                }
            }
            return(rpta);
        }
Example #22
0
 private void TextBox1_TextChanged(object sender, EventArgs e)
 {
     if (TextBox1.Text == "")
     {
         EP.SetError(TextBox1, "Fill the Company name first");
         TextBox1.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #23
0
 private void TextBox6_Leave(object sender, EventArgs e)
 {
     if (TextBox6.Text == "")
     {
         EP.SetError(TextBox6, "Fill the Blank Text first");
         TextBox6.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #24
0
 private void TextBox8_Leave(object sender, EventArgs e)
 {
     if (TextBox8.Text == "")
     {
         EP.SetError(TextBox8, "Fill the Test Cell no. first");
         TextBox8.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #25
0
    protected void dlContent_DeleteCommand(object source, DataListCommandEventArgs e)
    {
        string        ID     = this.dlContent.DataKeys[e.Item.ItemIndex].ToString(); //获取当前DataList控件列
        string        sqlstr = "delete from tb_tools where ID='" + Convert.ToInt32(ID) + "'";
        SqlConnection con    = new SqlConnection(EP.GetConStr());
        SqlCommand    com    = new SqlCommand(sqlstr, con);

        con.Open();
        com.ExecuteNonQuery();
        con.Close();
        this.bindDataList();
    }
Example #26
0
 public ActionResult Edit([Bind(Include = "EPID,Estado_Entrega,Fecha_Inicial,Fecha_Final,Descripcion,ElementosID,PrestamosID")] EP eP)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eP).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ElementosID = new SelectList(db.Elementos, "ElementosID", "Numero_Serial", eP.ElementosID);
     ViewBag.PrestamosID = new SelectList(db.Prestamos, "PrestamosID", "Estado_Disposicion", eP.PrestamosID);
     return(View(eP));
 }
Example #27
0
 private void TextBox9_Leave(object sender, EventArgs e)
 {
     if (TextBox9.Text == "")
     {
         EP.SetError(TextBox9, "Fill the first start time first");
         TextBox9.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #28
0
        private bool LosDatosIngresadosSonCorrectos()
        {
            LimpiarEP();

            if (Controles.IsNullOEmptyElControl(txtNombre))
            {
                EP.SetError(txtNombre, "Este campo no puede quedar vacío");
                txtNombre.Focus();
                return(false);
            }
            return(true);
        }
Example #29
0
 private void TextBox4_Leave(object sender, EventArgs e)
 {
     if (TextBox4.Text == "")
     {
         EP.SetError(TextBox4, "Fill the Max RPM first");
         TextBox4.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #30
0
 private void TextBox2_Leave(object sender, EventArgs e)
 {
     if (TextBox2.Text == "")
     {
         EP.SetError(TextBox2, "Fill the Department first");
         TextBox2.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #31
0
        public Expr Copy(EP flag)
        {
            #region EP_TokenOnly
            var cp = new Expr
            {
                op = op,
                affinity = affinity,
                flags = flags,
                u = u,
            };
            if ((flag & EP.TokenOnly) != 0) return cp;
            #endregion
            #region EP_Reduced
            if (pLeft != null)
                cp.pLeft = pLeft.Copy();
            if (pRight != null)
                cp.pRight = pRight.Copy();
            cp.x = x;
            cp.pColl = pColl;
            if ((flag & EP.Reduced) != 0) return cp;
            #endregion
            #region Remaining
            cp.iTable = iTable;
            cp.iColumn = iColumn;
            cp.iAgg = iAgg;
            cp.iRightJoinTable = iRightJoinTable;
            cp.flags2 = flags2;
            cp.op2 = op2;
            cp.pAggInfo = pAggInfo;
            cp.pTab = pTab;
#if SQLITE_MAX_EXPR_DEPTH
            cp.nHeight = nHeight;
            cp.pZombieTab = pZombieTab;
#endif
            return cp;
            #endregion
        }
Example #32
0
    public string SendCommand(string commandtype, string commandbody, string SK)
    {

        string[,] p = new string[2, 2];
        p[0, 0] = "commandtype";
        p[1, 0] = commandtype;
        p[0, 1] = "commandbody";
        p[1, 1] = commandbody;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK)) return COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4");

        commandtype = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(commandtype);
        commandbody = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(commandbody);

        if (commandtype.ToLower().Trim() == "i")
        {

            string[] body = commandbody.Split('|');

            string hccu_id = body[1];
            string mac = body[2];
            string ip = body[3];
            string prop = body[4];

            EP ep = new EP();

            string skraw = "EP_TypeId=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1")
                            + "&EP_UserDefined_Alias=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt("Unknown")
                            + "&EP_ProductId=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1")
                            + "&HCCU_Id=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id)
                            + "&EP_MAC_Id=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(mac)
                            + "&PROPFORMAT=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(prop)
                            + "&IP=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(ip);

            string sk = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(skraw);

            return ep.EP_Add_20140320(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1"),
                COS_SECURITY_TOOL.SECURITY_ContentEncrypt("Unknown"),
                COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1"),
                COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id),
                COS_SECURITY_TOOL.SECURITY_ContentEncrypt(mac),
                COS_SECURITY_TOOL.SECURITY_ContentEncrypt(prop),
                COS_SECURITY_TOOL.SECURITY_ContentEncrypt(ip),
                sk);

        }

        else if (commandtype.ToLower().Trim() == "d")
        {

            string[] body = commandbody.Split('|');

            if (body.Length < 5) return "";

            string hccu_id = body[1];
            string mac = body[2];
            string d_length = body[3];

            if (mac.Length != 16) return "";

            COS_WEBSERVICE_EP c = new COS_WEBSERVICE_EP();
            string epid = Get_EPID_From_MAC(mac);


            ParseDataCommand(commandbody, epid, d_length, hccu_id);


            string skraw = "EP_ID=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(epid);
            string sk = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(skraw);

            EXEC_ORDER e = new EXEC_ORDER();
            return e.EXEC_ORDER_Get_WithIP(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(epid), sk);


        }
        else
        {

            return "";
        }

    }
Example #33
0
 // These macros can be used to test, set, or clear bits in the Expr.flags field.
 internal static bool ExprHasProperty(Expr E, EP P) { return (E.flags & P) == P; }
Example #34
0
 internal static bool ExprHasAnyProperty(Expr E, EP P) { return (E.flags & P) != 0; }
Example #35
0
 internal static void ExprSetProperty(Expr E, EP P) { E.flags = (E.flags | P); }
Example #36
0
 internal static void ExprClearProperty(Expr E, EP P) { E.flags = (E.flags & ~P); }
Example #37
0
        public ITable pZombieTab;      // List of Table objects to delete after code gen
#endif
        #endregion

        public void CopyFrom(Expr cf)
        {
            op = cf.op;
            affinity = cf.affinity;
            flags = cf.flags;
            u = cf.u;
            pColl = (cf.pColl == null ? null : cf.pColl.Copy());
            iTable = cf.iTable;
            iColumn = cf.iColumn;
            pAggInfo = (cf.pAggInfo == null ? null : cf.pAggInfo.Copy());
            iAgg = cf.iAgg;
            iRightJoinTable = cf.iRightJoinTable;
            flags2 = cf.flags2;
            pTab = (cf.pTab == null ? null : cf.pTab);
#if SQLITE_MAX_EXPR_DEPTH
            nHeight = cf.nHeight;
            pZombieTab = cf.pZombieTab;
#endif
            pLeft = (cf.pLeft == null ? null : cf.pLeft.Copy());
            pRight = (cf.pRight == null ? null : cf.pRight.Copy());
            x.pList = (cf.x.pList == null ? null : cf.x.pList.Copy());
            x.pSelect = (cf.x.pSelect == null ? null : cf.x.pSelect.Copy());
        }