Beispiel #1
0
        static void Main(string[] args)
        {
            Db db = new Db();
            DataSet ds = db.ReturnFormData(1);

            AlpacaFactory factory = new AlpacaFactory();

            factory.ReturnForm(ds);

            var x = "x";
        }
        public IHttpActionResult GetForm(int id)
        {
            try
            {
                DataSet ds = new Db().ReturnFormData(id);

                if(ds.Tables.Count == 4)
                {
                    AlpacaFactory frm = new AlpacaFactory();
                    dynamic obj = frm.ReturnForm(ds);
                    return Ok(obj);
                }
                else
                {
                    return InternalServerError(new Exception("Database output incorrect"));
                }
            }
            catch(Exception ex)
            {
                return InternalServerError(ex);
            }
        }