示例#1
0
        public override object Write(object obj, bool delete)
        {
            //AuxVariables
            object result;
            string table_name;

            Controllers.ClassType class_type;
            OleDbCommand          command;

            //Run Method
            result = obj;
            if (OpenConnection())
            {
                if ((table_name =
                         GetTableName(
                             new Controllers.StorageController("", "").
                             GetClassTypeOfObject(obj))) != "")
                {
                    command            = new OleDbCommand();
                    command.Connection = connection;
                    class_type         = new Controllers.StorageController("", "").
                                         GetClassTypeOfObject(obj);
                    switch (class_type)
                    {
                    case ClassType.account:
                        result = WriteAccount(obj, delete, command);
                        break;

                    case ClassType.accounting_record:
                        result = WriteAccountingRecord(obj, delete, command);
                        break;

                    case ClassType.accounting_record_line:
                        result = WriteAccountingRecordLine(obj, delete, command);
                        break;

                    default:
                        break;
                    }
                }
                CloseConnection();
            }
            return(result);
        }
示例#2
0
 //Constructors
 private void ConstructorCode()
 {
     storage_controller = new Controllers.StorageController("", "");
 }