Ejemplo n.º 1
0
        public static ResultSet CRUD(Customers cus, Cate cate, Products pro, Orders ord, Signin sign, EntityState state, string table)
        {
            ResultSet r = new ResultSet();

            try {
                switch (table)
                {
                case "customer": r = HelperCustomer.CRUD(cus, state); break;

                case "category": r = HelperCate.CRUD(cate, state); break;

                case "product": r = HelperProduct.CRUD(pro, state); break;

                case "order": r = HelperOrder.CRUD(ord, state); break;

                case "signin": r = HelperSignin.CRUD(sign, state); break;

                default: break;
                }
                if (r.Message != null)
                {
                    MessageBox.Show(r.Message, "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                return(r);
            }
            catch (Exception e) {
                r.Message = e.Message;
            }
            return(r);
        }