public bool DeleteAll()
        {
            string w_query = string.Format(@"DELETE FROM {0};"
                                           , m_tableName
                                           );

            bool w_ret = DbAssist.executeCommand(w_query);

            return(w_ret);
        }
        public bool UpdateItem(ITeam udTeam)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"UPDATE {0} SET name='{1}', desc='{2}';"
                                           , m_tableName
                                           , udTeam.name
                                           , udTeam.desc
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
        public bool AddItem(ITeam newTeam)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"INSERT INTO {0} (name, desc) VALUES ('{1}', '{2}')"
                                           , m_tableName
                                           , newTeam.name
                                           , newTeam.desc
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
        public bool DeleteItem(ITeam delTeam)
        {
            bool w_ret = false;

            string w_query = string.Format(@"DELETE FROM {0} WHERE id='{1}';"
                                           , m_tableName
                                           , delTeam.id
                                           );

            w_ret = DbAssist.executeCommand(w_query);

            return(w_ret);
        }
Exemple #5
0
        public bool DeleteAll(int year, int month)
        {
            bool w_ret = false;

            string w_query = string.Format(@"DELETE FROM {0} WHERE year='{1}' AND month='{2}';"
                                           , m_tableName
                                           , year
                                           , month
                                           );

            w_ret = DbAssist.executeCommand(w_query);

            return(w_ret);
        }
        public bool AddItem(IEmployee newEmployee)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"INSERT INTO {0} (f_name, g_name, email, code, team, invisible) VALUES ('{1}', '{2}', '{3}', '{4}', '{5}', '{6}')"
                                           , m_tableName
                                           , newEmployee.f_name
                                           , newEmployee.g_name
                                           , newEmployee.email
                                           , newEmployee.code == "full time" ? 1 : 0
                                           , newEmployee.team
                                           , newEmployee.invisible
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
Exemple #7
0
        public bool AddItem(IReport newItem)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"INSERT INTO {0} (year, month, day, employee, product, amount) VALUES ('{1}', '{2}', '{3}', '{4}', '{5}', '{6}')"
                                           , m_tableName
                                           , newItem.year
                                           , newItem.month
                                           , newItem.day
                                           , newItem.employee
                                           , newItem.product
                                           , newItem.amount
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
        public bool UpdateItem(IEmployee udEmployee)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"UPDATE {0} SET f_name='{1}', g_name='{2}', email='{3}', code='{4}', team='{5}', invisible='{6}' WHERE id='{7}';"
                                           , m_tableName
                                           , udEmployee.f_name
                                           , udEmployee.g_name
                                           , udEmployee.email
                                           , udEmployee.code == "full time" ? 1 : 0
                                           , udEmployee.team
                                           , udEmployee.invisible
                                           , udEmployee.id
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
Exemple #9
0
        public bool UpdateItem(IReport udReport)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"UPDATE {0} SET year='{1}', month='{2}', day='{3}', employee='{4}', product='{5}', amount='{6}' WHERE id='{7}';"
                                           , m_tableName
                                           , udReport.year
                                           , udReport.month
                                           , udReport.day
                                           , udReport.employee
                                           , udReport.product
                                           , udReport.amount
                                           , udReport.id
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
        public bool AddItem(IProduct newItem)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"INSERT INTO {0} (id, name, type, cost, price, weight, invisible) VALUES ('{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}')"
                                           , m_tableName
                                           , newItem.id
                                           , newItem.name
                                           , newItem.type == "Group" ? 1 : 0
                                           , newItem.cost
                                           , newItem.price
                                           , newItem.weight
                                           , newItem.invisible
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }
        public bool UpdateItem(IProduct udProduct)
        {
            bool   w_ret   = false;
            string w_query = string.Format(@"UPDATE {0} SET name='{1}', type='{2}', cost='{3}', price='{4}', weight='{5}', invisible='{6}' WHERE id='{7}';"
                                           , m_tableName
                                           , udProduct.name
                                           , udProduct.type == "Group" ? 1 : 0
                                           , udProduct.cost
                                           , udProduct.price
                                           , udProduct.weight
                                           , udProduct.invisible
                                           , udProduct.id
                                           );

            w_ret = DbAssist.executeCommand(w_query);
            return(w_ret);
        }