Esempio n. 1
0
        private TypeCrimen ConvertToTypeCrimen(DataRow dr)
        {
            TypeCrimen z = new TypeCrimen();

            if (dr != null)
            {
                z.TypeCrimenId   = Convert.ToInt32(dr["TypeCrimeId"]);
                z.Crimen         = Convert.ToString(dr["Crime"]);
                z.Description    = dr["Description"].ToString();
                z.Code           = dr["Code"].ToString();
                z.Article        = Convert.ToString(dr["Article"]);
                z.OrganizationId = Convert.ToInt32(dr["OrganizationId"]);
            }
            return(z);
        }
Esempio n. 2
0
        public static List <GroupTypeCrimen> getGroupTypeCrimen(string search)
        {
            List <GroupTypeCrimen> lgp = new List <GroupTypeCrimen>();
            DBTransaction          db  = new DBTransaction();
            List <SqlParameter>    lp  = new List <SqlParameter>();

            lp.Add(new SqlParameter("@Search", search));
            DataTable dt = db.GetStoreProcedure("den.GetOrganization", lp);

            foreach (DataRow dr in dt.Rows)
            {
                GroupTypeCrimen gp = new GroupTypeCrimen();
                gp = gp.ConvertToGroupTypeCrimen(dr);
                TypeCrimen tc = new TypeCrimen();
                gp.TypeCrimens = tc.getTypeCrimeByOrganization(gp.OrganizationId, search);
                lgp.Add(gp);
            }
            return(lgp);
        }