Exemplo n.º 1
0
        public uint SetCityRel(uint city_id, uint rel_id, int rel_num)
        {
            int typeint = lc_ObjGather.GetRelNameMap("STU_CITY_INF");
            int index   = objgather.relship_list[typeint].FindIndex(delegate(STU_RELATION temp) {
                STU_CITY_INF substu = (STU_CITY_INF)temp;
                if (substu.city_id == city_id)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            });

            if (index != -1)
            {
                STU_CITY_INF stu      = (STU_CITY_INF)objgather.relship_list[typeint][index];
                int          subindex = stu.rel_rat.FindIndex(delegate(SUBSTU_REL_RAT temp) { return(temp.rel_id == rel_id); });
                if (subindex == -1)
                {
                    SUBSTU_REL_RAT substu = new SUBSTU_REL_RAT(rel_id, rel_num);
                    stu.rel_rat.Add(substu);
                    return(stu.relship_id);
                }
                else
                {
                    stu.rel_rat[subindex].rel_num += rel_num;
                    return(stu.relship_id);
                }
            }
            return(0);
        }
Exemplo n.º 2
0
 public SUBSTU_REL_RAT(SUBSTU_REL_RAT temp)
 {
     this.rel_id  = temp.rel_id;
     this.rel_num = temp.rel_num;
 }