Example #1
0
 public Rol(int idRol, string nombreRol, List<Privilegio> listaPrivilegios, string descripcionRol, Boolean estado )
 {
     this.idRol = idRol;
     this.nombreRol = nombreRol;
     this.listaPrivilegios = listaPrivilegios;
     this.descripcionRol = descripcionRol;
     if (estado.Equals("Activo"))
         this.estadoRol = true;
     else if (estado.Equals("Inactivo"))
         this.estadoRol = false;
 }
Example #2
0
        protected void BtnOk_Click(object sender, EventArgs e)
        {
            busEmployees busemp = new busEmployees();
            Employees frmEmp = new Employees();
            frmEmp.FullName = this.txtFullname.Text;
            frmEmp.Email = this.txtEmail.Text;
            frmEmp.Login = this.txtLogin.Text;
            frmEmp.LastName = this.txtLastName.Text;
            frmEmp.passwords = this.txtPassword.Text;
            frmEmp.IDAccess = int.Parse(this.ddpAccess.SelectedValue);

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('User existing')", true);
            }
            else
            {
                string x = busemp.insertEmployee(frmEmp);

                if (x.Trim() == string.Empty)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Successfully added new User')", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Failed to added new User')", true);
                }
            }
            //DataTable dt = new DataTable("User");
            //dt = busemp.allUser();
            //GridView1.DataSource = dt;
            //GridView1.DataBind();
        }
Example #3
0
        protected void BtnOk_Click(object sender, EventArgs e)
        {
            busProducts busProd = new busProducts();
            FrameWork.Products frmProd = new FrameWork.Products();
            frmProd.ProductName = this.txtProdName.Text;
            frmProd.ProductCode = this.txtCode.Text;
            frmProd.Description = this.txtProdDescription.Text;
            frmProd.CategoryID = int.Parse(this.drpCategory.SelectedValue);
            frmProd.ProductSizeID = int.Parse(this.drpSize.SelectedValue);
            frmProd.UnitOfMeasureID = int.Parse(this.drpUOM.SelectedValue);
            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Product already Exists')", true);
            }
            else
            {

                string x = busProd.insertProducts(frmProd);

                if (x.Trim() == string.Empty)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Successfully added new Product')", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Failed to added new Product')", true);
                }
            }
            DataTable dt = new DataTable("User");
            dt = busProd.allProducts();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        // Stored Procedures -> type = true
        // Sentencias SQL    -> type = false
        public static DataSet executeDataset(String ps_command, Boolean pu_type, cls_parameter[] pa_parameters)
        {
            try
            {
                IDbCommand vu_cmd = cu_dataProvider.command(ps_command);
                foreach (cls_parameter vu_parameter in pa_parameters)
                    vu_cmd.Parameters.Add(cu_dataProvider.parameter(vu_parameter));

                DataSet vu_dts = new DataSet();
                IDbDataAdapter vu_adp = cu_dataProvider.adapter();
                vu_adp.SelectCommand = vu_cmd;

                if (pu_type.Equals(true))
                    vu_adp.SelectCommand.CommandType = CommandType.StoredProcedure;

                if (cu_transaction != null)
                {
                    vu_adp.SelectCommand.Connection = cu_transaction.Connection;
                    vu_adp.SelectCommand.Transaction = cu_transaction;
                    vu_adp.Fill(vu_dts);
                }
                else
                {
                    vu_adp.SelectCommand.Connection = getInstance().getConnection();
                    vu_adp.Fill(vu_dts);
                    closeConnection();
                }

                return vu_dts;
            }
            catch (Exception ve_exception)
            {
                throw ve_exception;
            }
        }
Example #5
0
 public virtual void  startElement(System.String str, System.String str2, System.String tag, SaxAttributesSupport attributes)
 {
     //UPGRADE_TODO: The 'System.Boolean' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
     if (!tag.Equals("Match") && matchAlreadyFound == null)
     {
         matchAlreadyFound = false;
     }
     //UPGRADE_TODO: The 'System.Boolean' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
     if (tag.Equals("Match") && matchAlreadyFound == null && attributes.GetValue("date").Equals(todayString))
     {
         /* The match file needs to be parsed */
         matchAlreadyFound = true;
         currentHomeTeam   = attributes.GetValue("home");
         currentAwayTeam   = attributes.GetValue("away");
     }
     //UPGRADE_TODO: The 'System.Boolean' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
     if (matchAlreadyFound != null && matchAlreadyFound.Equals(true))
     {
         if (tag.Equals("Score"))
         {
             currentHomeScore = System.Int32.Parse(attributes.GetValue("home"));
             currentAwayScore = System.Int32.Parse(attributes.GetValue("away"));
         }
     }
 }
 /// <summary>
 /// ennable the menu strip 
 /// the value was passed from the frmLogin through a boolean 
 /// </summary>
 /// <param name="pBlnEnableMenuStrip"></param>
 public void OrganizeMenuStrip(Boolean pBlnEnableMenuStrip)
 {
     if (pBlnEnableMenuStrip.Equals(true))
         MainMenuStrip.Enabled = true;
     else
         MainMenuStrip.Enabled = false;
 }
        static StackObject *Equals_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean obj = ptr_of_this_method->Value == 1;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Boolean instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.Equals(obj);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Example #8
0
 public virtual void  startElement(System.String str, System.String str2, System.String tag, SaxAttributesSupport attributes)
 {
     //UPGRADE_TODO: The 'System.Boolean' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
     if (!tag.Equals("Match") && matchAlreadyFound == null)
     {
         matchAlreadyFound = false;
     }
     //UPGRADE_TODO: The 'System.Boolean' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
     if (tag.Equals("Match") && matchAlreadyFound == null && (!dateDriven || attributes.GetValue("date").Equals(todayString)))
     {
         /* The match file needs to be parsed */
         matchAlreadyFound = true;
         currentMatch      = new Match(attributes.GetValue("home"), attributes.GetValue("away"));
     }
     //UPGRADE_TODO: The 'System.Boolean' structure does not have an equivalent to NULL. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1291'"
     if (matchAlreadyFound != null && matchAlreadyFound.Equals(true))
     {
         if (tag.Equals("Score"))
         {
             currentMatch.setScore(System.Int32.Parse(attributes.GetValue("home")), System.Int32.Parse(attributes.GetValue("away")));
         }
         else if (tag.Equals("TeamStats"))
         {
             currentTeam = attributes.GetValue("team");
         }
         else if (tag.Equals("PlayerStats"))
         {
             try
             {
                 if (System.Int32.Parse(attributes.GetValue("minutes")) == 0)
                 {
                     currentMatch.addPlayer(currentTeam, new UpdaterPlayer(attributes.GetValue("name")));
                 }
                 else
                 {
                     currentMatch.addPlayer(currentTeam, new UpdaterPlayer(attributes.GetValue("name"), System.Int32.Parse(attributes.GetValue("keepingAbility")), System.Int32.Parse(attributes.GetValue("tacklingAbility")), System.Int32.Parse(attributes.GetValue("passingAbility")), System.Int32.Parse(attributes.GetValue("shootingAbility")), System.Int32.Parse(attributes.GetValue("saves")), System.Int32.Parse(attributes.GetValue("keyTackling")), System.Int32.Parse(attributes.GetValue("keyPassing")), System.Int32.Parse(attributes.GetValue("assists")), System.Int32.Parse(attributes.GetValue("shots")), System.Int32.Parse(attributes.GetValue("goals")), System.Int32.Parse(attributes.GetValue("yellowCards")), System.Int32.Parse(attributes.GetValue("redCards")), attributes.GetValue("injured").ToUpper().Equals("TRUE")));
                 }
             }
             catch (System.Exception err)
             {
                 //UPGRADE_TODO: Class 'org.xml.sax.SAXException' was converted to 'System.Xml.XmlException' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
                 throw new System.Xml.XmlException("", err);
             }
         }
     }
 }
Example #9
0
        static StackObject *Equals_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @obj = (System.Object) typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Boolean instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.Equals(@obj);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Example #10
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            busThick buscat = new busThick();
            FrameWork.Thick frmcat = new FrameWork.Thick();
            frmcat.Thickness = this.txtCategory.Text;

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Width existing')", true);
            }
            else
            {
                buscat.insertCategory(frmcat);
            }
            DataTable dt = new DataTable("User");
            dt = buscat.allCategories();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #11
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            busSizes bussize = new busSizes();
            FrameWork.Sizes frmcat = new FrameWork.Sizes();
            frmcat.ProductSize = this.txtSizes.Text;

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Size existing')", true);
            }
            else
            {
                bussize.insertSizes(frmcat);
            }
            DataTable dt = new DataTable("User");
            dt = bussize.allSize ();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            busUnitOfMeasure busuom = new busUnitOfMeasure();
            FrameWork.UnitOfMeasures frmcat = new FrameWork.UnitOfMeasures();
            frmcat.UnitOfMeasure = this.txtUOM.Text;

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Unit Of Measure existing')", true);
            }
            else
            {
                busuom.insertMeasures(frmcat);
            }
            DataTable dt = new DataTable("User");
            dt = busuom.allUOM();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        public IEnumerable<Empleado> GetEmpleados(string criterio, Boolean estado)
        {
            //var query = from e in Context.Empleados.Include("Cargo")
            var query = from e in Context.Empleados.Include(c => c.Cargo)
                        select e;

            if (!String.IsNullOrEmpty(criterio))
	        {
                query = from q in query
                        where q.Dni.Contains(criterio) 
                        || (q.ApellidoPaterno +" "+q.ApellidoMaterno +" "+ q.Nombres).Contains(criterio)
                        select q;
	        }

            if(estado.Equals(true))
            {
                query = from e in query
                        where e.Estado.Equals(true)
                        select e;
            }

            return query;
        }
Example #14
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            busEmployees busemp = new busEmployees();
            Employees frmEmp = new Employees();
            frmEmp.FullName = this.txtFullname.Text;
            frmEmp.Email = this.txtEmail.Text;
            frmEmp.Login = this.txtLogin.Text;
            frmEmp.LastName = this.txtLastName.Text;
            frmEmp.passwords = this.txtPassword.Text;

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('User existing')", true);
            }
            else
            {
                busemp.insertEmployee(frmEmp);
            }
            DataTable dt = new DataTable("User");
            dt = busemp.allUser();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #15
0
 public bool Equals(AgentData other)
 {
     return(Timeline.Equals(other.Timeline) && Safe.Equals(other.Safe) && HasWeapon.Equals(other.HasWeapon));
 }
        // Stored Procedures -> type = true
        // Sentencias SQL    -> type = false
        public static int executeNonQuery(String ps_command, Boolean pu_type, cls_parameter[] pa_parameters)
        {
            int vi_result = -1;

            try
            {
                IDbCommand vu_cmd = cu_dataProvider.command(ps_command);
                foreach (cls_parameter vu_parameter in pa_parameters)
                    vu_cmd.Parameters.Add(cu_dataProvider.parameter(vu_parameter));

                if (pu_type.Equals(true))
                    vu_cmd.CommandType = CommandType.StoredProcedure;

                if (cu_transaction != null)
                {
                    vu_cmd.Connection = cu_transaction.Connection;
                    vu_cmd.Transaction = cu_transaction;
                    vi_result = vu_cmd.ExecuteNonQuery();
                }
                else
                {
                    vu_cmd.Connection = getInstance().getConnection();
                    vi_result = vu_cmd.ExecuteNonQuery();
                    vu_cmd.Dispose();
                    closeConnection();
                }

                return vi_result;
            }
            catch (Exception ve_exception)
            {
                throw ve_exception;
            }
        }
Example #17
0
 public bool Equals(DoorData other)
 {
     return(Open.Equals(other.Open));
 }
Example #18
0
 public bool Equals(CoverData other)
 {
     return(SpotTaken.Equals(other.SpotTaken) && Direction.Equals(other.Direction));
 }
Example #19
0
 public bool Equals(WaypointData other)
 {
     return(Left.Equals(other.Left) && Right.Equals(other.Right) && Up.Equals(other.Up) && Down.Equals(other.Down) && Occupied.Equals(other.Occupied) && StepsToEnd.Equals(other.StepsToEnd));
 }
Example #20
0
 public static String FormatColumnForJson(String colName, String sdt, String alias, Boolean nullable)
 {
     String result = String.Empty;
     alias = String.IsNullOrEmpty(alias) ? String.Format("[{0}]", colName) : String.Format("[{0}].[{1}]", alias, colName);
     switch (sdt.ToLower())
     {
         case "ntext":
         case "text":
             result = nullable.Equals(true) ?
                 result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(NVarchar(max),{1})+'\",','\"{0}\":null,')+", colName, alias) :
                 result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(NVarchar(max),{1})+'\",','')+", colName, alias);
             break;
         case "uniqueidentifier":
             result = nullable.Equals(true) ?
                 String.Format("ISNULL('\"{0}\":\"'+CONVERT(VarChar(36),{1})+'\",','\"{0}\":null,')+", colName, alias) :
                 String.Format("ISNULL('\"{0}\":\"'+CONVERT(VarChar(36),{1})+'\",','')+", colName, alias);
             break;
         case "string":
         case "char":
         case "nchar":
         case "nvarchar":
         case "varchar":
             result = nullable.Equals(true) ?
                 String.Format("ISNULL('\"{0}\":\"'+{1}+'\",','\"{0}\":null,')+", colName, alias) :
                 String.Format("ISNULL('\"{0}\":\"'+{1}+'\",','')+", colName, alias);
             break;
         case "date":
         case "datetime":
         case "smalldatetime":
             result = nullable.Equals(true) ?
                 result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(Varchar(25),{1}, 121)+'\",','\"{0}\":null,')+", colName, alias) :
                 result = String.Format("ISNULL('\"{0}\":\"'+CONVERT(Varchar(25),{1}, 121)+'\",','')+", colName, alias);
             break;
         case "bigint":
             result = String.Format("'\"{0}\":\'+CONVERT(Varchar(30),ISNULL({1},0))+','+", colName, alias);
             break;
         case "numeric":
         case "number":
         case "decimal":
         case "float":
         case "int":
         case "money":
         case "real":
         case "smallmoney":
             result = String.Format("'\"{0}\":\'+CONVERT(Varchar(18),ISNULL({1},0))+','+", colName, alias);
             break;
         case "smallint":
             result = String.Format("'\"{0}\":\'+CONVERT(Varchar(7),ISNULL({1},0))+','+", colName, alias);
             break;
         case "tinyint":
             result = String.Format("'\"{0}\":\'+CONVERT(Varchar(5),ISNULL({1},0))+','+", colName, alias);
             break;
         case "boolean":
         case "bool":
         case "bit":
             result = string.Format("'\"{0}\":\'+CASE WHEN {1} = ISNULL({1},0) THEN 'false' ELSE 'true' END+','+", colName, alias);
             break;
         default: result = String.Empty;
             break;
     }
     return result;
 }