Пример #1
0
        /*     internal Models.GuardianModel.GetParentStudentListResp GetParentStudentList(Models.GuardianModel.GetParentStudentListReq req)
         *    {
         *        Models.GuardianModel.GetParentStudentListResp rsp = new Models.GuardianModel.GetParentStudentListResp();
         *
         *        List<ITGuardian> IGuard = _storage.GetParentStudentList();
         *        List<Models.GuardianModel.LiGuardianRelation> Relation = new List<Models.GuardianModel.LiGuardianRelation>();
         *        Models.GuardianModel.LiGuardianRelation PS;
         *        if (IGuard!=null)
         *        {
         *            foreach(ITGuardian ig in IGuard)
         *            {
         *                PS = new Models.GuardianModel.LiGuardianRelation();
         *                ITEntity e = _storage.GetEntityByID(ig.nEntityFKParent);
         *                PS.sPName = e.sFname + " " + e.sMname + " " + e.sLname;
         *                e = _storage.GetEntityByID(ig.nEntityFKStudent);
         *                PS.sSName= e.sFname + " " + e.sMname + " " + e.sLname;
         *                PS.sClass = _storage.GetDetails(ig.nEntityFKStudent).sClass;
         *                PS.nGuardianId = ig.n;
         *                Relation.Add(PS);
         *            }
         *        }
         *        if (Relation.Count > 0)
         *        { rsp.LiGuardian = Relation; rsp.apiEror.jErrorVal = 0; }else { rsp.apiEror.sErrorMessage = "Cant retrieve the list"; }
         *        return rsp;
         *    }       */

        internal Models.GuardianModel.GetChildrenResp GetChildren(Models.GuardianModel.GetChildrenReq req)
        {
            Models.GuardianModel.GetChildrenResp rsp = new Models.GuardianModel.GetChildrenResp();
            rsp.apiError           = new APIErrors();
            rsp.apiError.jErrorVal = 0;
            List <ITGuardian> LiChildren = _storage.GetChildren(req.nEntityFKParent);
            ITEnityDetails    detail;
            ITEntity          entity;

            rsp.LiChildren = new List <Models.GuardianModel.Relative>();
            Models.GuardianModel.Relative ward;
            //Added Entity
            if (LiChildren.Count > 0)
            {
                foreach (ITGuardian child in LiChildren)
                {
                    entity           = _storage.GetEntityByID(child.nEntityFKStudent);
                    detail           = detail = _storage.GetDetails(child.nEntityFKStudent);
                    ward             = new Models.GuardianModel.Relative();
                    ward.nRecordId   = child.n;
                    ward.nRelativeId = child.nEntityFKStudent; ward.sFname = entity.sFname; ward.sMname = entity.sMname; ward.sLname = entity.sLname; ward.sClass = detail.sClass;
                    rsp.LiChildren.Add(ward);
                }
                rsp.apiError.jErrorVal = 0;
            }
            else
            {
                rsp.apiError.sErrorMessage = "Unable to get Children";
            }
            return(rsp);
        }
Пример #2
0
 public object GetChildren([FromBody] Models.GuardianModel.GetChildrenReq req)
 {
     Bllfiles.BLL_Mapping bllentity            = new Bllfiles.BLL_Mapping();
     Models.GuardianModel.GetChildrenResp resp = bllentity.GetChildren(req);
     return(resp);
 }