Exemplo n.º 1
0
        public string application(Need need)
        {
            try
            {
                result = orm.execObject <Result>(need, "api.need_application");

                //wanna get need name and applicant name fro the result
                //so first find the rigth need and then the right applicant

                //Get need
                var fullNeed = (from x in ((Result)result).Round.Needs
                                where x.token == need.token
                                select x).ToList()[0];

                var application = (from x in ((Need)fullNeed).Applications
                                   where x.User.token == need.Application.User.token
                                   select x).ToList()[0];

                need.name = fullNeed.name;
                need.Application.User.name = application.User.name;


                MessageHelpers.senderFoundApplicationMail(result, need);
            }
            catch (Exception exp)
            {
                errorResult(exp);
            }
            return(formattedResult(result));
        }