protected override OpResult _Store(WritePaychequeLine _obj)
        {
            if (_obj == null)
            {
                return(OpResult.NotifyStoreAction(OpResult.ResultStatus.ObjectIsNull, _obj, "WritePaychequeLine object cannot be created as it is null"));
            }

            if (Exists(_obj))
            {
                ExecuteNonQuery(GetQuery_UpdateQuery(_obj));
                return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Updated, _obj));
            }

            ExecuteNonQuery(GetQuery_InsertQuery(_obj));
            _obj.FromDb = true;
            return(OpResult.NotifyStoreAction(OpResult.ResultStatus.Created, _obj));
        }
 private DbUpdateStatement GetQuery_UpdateQuery(WritePaychequeLine _obj)
 {
     return(DbMgr.CreateUpdateClause("WritePaychequeLines", GetFields(_obj), "WritePaychequeLineID", _obj.WritePaychequeLineID));
 }
        private DbInsertStatement GetQuery_InsertQuery(WritePaychequeLine _obj)
        {
            Dictionary <string, DbFieldEntry> fields = GetFields(_obj);

            return(DbMgr.CreateInsertClause("WritePaychequeLines", fields));
        }